Skip to main content

A simple interface class that includes all the relevant information about BigEarthNet patches.

Project description

BigEarthNet Patch Interface

A simple interface class that includes all the relevant information about BigEarthNet patches.

Tests MyPy Type Checker License Python Versions PyPI version Conda Version pdm-managed Auto Release

A common issue when using a BigEarthNet archive is that the code to load a patch is

  • Slow
  • The necessary libraries to load the data have complex dependencies and cause issues with popular deep-learning libraries
    • The issue is often caused by a binary mismatch between the underlying numpy versions
  • Hard to understand how to access the optimized data

A popular approach is to use the key-value storage LMDB. The patch names are set as keys, and the value is somehow encoded. Decoding the values is a common source of bugs when different deep-learning libraries are used.

The goal of this repository is to alleviate this issue. The actual image data will be encoded as numpy arrays to support the most popular deep-learning libraries. Usually, these arrays can be loaded without copying the underlying data.

The provided patch interface will define a Python class containing the relevant bands, encoded as an np.ndarray, and may include some metadata. The interface class allows for fast introspection, validation, and data loading.

It is easier to convert this intermediate data format to a more deep-learning optimized format or use the class itself for embedding in a key-value storage format like LMDB. Please refer to the official {{BenEncoder}} documentation for details on how to generate various output formats.

In general, the encoding pipeline is as follows:

  1. Convert the BigEarthNet patches into numpy arrays
  2. Use these arrays to initialize the interface class
  3. Provide any additional metadata information to the interface
  4. Serialize/convert the data to the desired output format

The decoder should be as simple as possible with minimal dependencies. Ideally, the correct usage of the decoder should also be depicted in the corresponding {{BenEncoder}} section.

:::{note} This interface is tightly coupled with the {{BenEncoder}} libary!

The main reason for providing this interface as a standalone package is to minimize the required dependencies of a user that wants to load/use already encoded patches. Creating the interface from the raw data requires heavy libraries that often cause binary conflicts. The interface class can be installed as a standalone library and only requires the (easier to install) decoder libraries.

:::

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigearthnet-patch-interface-0.1.2.tar.gz (139.0 kB view hashes)

Uploaded Source

Built Distribution

bigearthnet_patch_interface-0.1.2-py3-none-any.whl (140.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page