Skip to main content

Welcome to fastgs

Introduction

This library is currently in alpha, neither the functionality nor the API is stable

This library provides geospatial multi-spectral image support for fastai. FastAI already has extensive support for RGB images in the pipeline. I try to achieve feature parity for multi-spectral images with this library, specifically in the context of Sentinel 2 geospatial imaging.

Sample Notebooks

You can find demo usage of the library at

  1. On the kaggle 38-cloud/95-cloud dataset

Install

pip install -Uqq fastgs
conda install -c restlessronin fastgs

How to use

The low-level functionality is wrapped into a class that loads sets of Sentinel 2 channels into a multi-spectral tensor (a TensorImageMS subclass of fastai TensorImage which itself is a subclass of the pytorch Tensor).

from fastgs.multispectral import *

The following code creates a class that can load 11 Sentinel 2 channels into a TensorImageMS.

from fastgs.vision.testio import * # defines read_multichan_files_as_tensor

sentinel2 = createSentinel2Descriptor()

snt_12 = MSData(
    sentinel2,
    ["B02","B03","B04","B05","B06","B07","B08","B8A","B11","B12","AOT"],
    [sentinel2.rgb_combo["natural_color"], ["B07","B06","B05"],["B12","B11","B8A"],["B08"]],
    get_channel_filenames,
    read_multichan_files
)

The second parameter is a list of 4 channel sets that are minimally required to visualize all the individual channels.

img_12 = snt_12.load_image(66)
img_12.show()
[<AxesSubplot:>, <AxesSubplot:>, <AxesSubplot:>, <AxesSubplot:>]

Acknowledgements

This library is inspired by the following notebooks (and related works by the authors)

Download files

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

Source Distribution

fastgs-0.0.22.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastgs-0.0.22-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file fastgs-0.0.22.tar.gz.

File metadata

  • Download URL: fastgs-0.0.22.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.6

File hashes

Hashes for fastgs-0.0.22.tar.gz
Algorithm Hash digest
SHA256 c84592171b745c8e3074edcbbb3ea5f788f9bbba6ed5e51e6f997b74a45d603c
MD5 f3bf57b9c017a82cf77833020790246b
BLAKE2b-256 72c82c1861989a62a70c08af16f66a57284d2332b1d52a66c99c60f505af39b7

See more details on using hashes here.

File details

Details for the file fastgs-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: fastgs-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.6

File hashes

Hashes for fastgs-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 d8887d8434ba9784c4f619f252c83bd101269926d8592207afe1fd126427113c
MD5 60b5b9a3241eb556c47489ee4a4a3b70
BLAKE2b-256 712971b0552b35ef87fc6ee2a5469b06af08df6f030477009493fe645d2ef272

See more details on using hashes here.

Supported by

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