Skip to main content

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

Project description

BigEarthNet Patch Interface

Tests License PyPI version 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 a key, 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. To support most popular deep-learning libraries, the actual image data will be encoded as numpy arrays. Usually, these arrays can be loaded without copying the underlying data.

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

In general, the encoding pipeline is as follows:

  1. To 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. Pickle the instance
  5. Store the instance to an LMDB database as a value (usually, the name of the patch is used as the key)

Only the LMDB database and the interface class are required to load the pre-converted data. This repository only contains the interface to minimize the required dependencies to unpickle the data.

Please be aware that pickle is insecure, and pickled data should never be trusted. For a detailed review on pickle, see the following post of synopsys on pickling. The primary benefit of pickle is that it comes with Python (requires no heavy dependencies), is blazingly fast, and allows for efficient serialization of various data types.

Do not forget to restrict write access to the pickled files when using them in a shared environment!

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.0.tar.gz (135.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file bigearthnet_patch_interface-0.1.0.tar.gz.

File metadata

  • Download URL: bigearthnet_patch_interface-0.1.0.tar.gz
  • Upload date:
  • Size: 135.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.12 Linux/5.13.0-1022-azure

File hashes

Hashes for bigearthnet_patch_interface-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bfb953c741aa6ccd2e44389bbfd9cfd95b85fb3a5625e56083df7c54e4dadc45
MD5 417e0228f32e3e490496f9d6e6fc5f3e
BLAKE2b-256 502a386fc9513537fccf43ef0026e394babd32f8ec4e96fcee4a0dcd5ed92f5e

See more details on using hashes here.

File details

Details for the file bigearthnet_patch_interface-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bigearthnet_patch_interface-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f218cd2f3008d82fd2f96f8049e0f89329d174f4becd6cb340130766891093e9
MD5 5a4bff76804d3a1086a2f8eeb2ead31d
BLAKE2b-256 1decf01473af1b76cca84aca3dc84c7060c1aac614713401f94759ab26431bff

See more details on using hashes here.

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