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
- On the kaggle 38-cloud/95-cloud landsat dataset
- With a private Sentinel 2 dataset
These are boths works in progress and purposely designed to display the features of the library.
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.test.io import * # defines read_multichan_files_as_tensor
sentinel2 = createSentinel2Descriptor()
snt_12 = MSData.from_all(
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastgs-0.0.24.tar.gz.
File metadata
- Download URL: fastgs-0.0.24.tar.gz
- Upload date:
- Size: 15.6 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.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f87e1493db81e1deeffe20fccbfdc9268b13178c5787569e936f3afc169aca1d
|
|
| MD5 |
449f5c765453baab1618c9dac77557f8
|
|
| BLAKE2b-256 |
cbba96b097716340dec9741bca046cc0e57c34ec26bb964e22e5317e8040cc8b
|
File details
Details for the file fastgs-0.0.24-py3-none-any.whl.
File metadata
- Download URL: fastgs-0.0.24-py3-none-any.whl
- Upload date:
- Size: 16.3 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.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76720c8f86403aa9fc868a13bd3a966639507ca757d326770c9ffa5356bc74ea
|
|
| MD5 |
779904bf48ee7790244918ffb1af8083
|
|
| BLAKE2b-256 |
16b150a3d36ca6a0547909e50d5fa9217e735479c3d38717b6a2b7bd431e2ab2
|