Logo Lanfrica

pavlo-seimskyi/semantic-segmentation-satellite-imagery

Domain:

geospatial

Record type:

dataset
Creator:
pav
Host:
This repository is a complete walkthrough to download the "landcovernet" dataset that contains label masks for Sentinel 2 images from Africa. It includes the data download, preprocessing and the model training with PyTorch and fastai. # Semantic Segmentation With Sentinel-2 Satellite Imagery This repository is a complete walkthrough to download the "landcovernet" dataset, clean and preprocess it, and train a Deep Learning U-Net model with it. # Environment ``` conda create -n segmentation python=3.8 activate segmentation pip install -r requirements.txt ``` # Data LandCoverNet dataset was released in July 2020. It is a global annual land cover classification training dataset with labels for the multi-spectral satellite imagery from Sentinel-2 mission in 2018. The documentation can be found here. There are total of 1980 image chips of 256x256 pixel in the current V1.0 version spanning 66 tiles of Sentinel-2. Each image chip contains temporal observations from Sentinel-2 surface reflectance product (L2A) at 10m spatial resolution and an annual class label, all stored in raster format (GeoTIFF files). The following schema is used for classification: # Downloading data To download the data, you first need to register on the Radiant MLHub website to get the API token. MLHub offers its API (documentation) to download the full dataset but one can also use a more raw Python script with the `urllib` library to download the data, using instructions provided here. By the time you read this tutorial, I hope the MLHub team has completed the API development and it works flawlessly. Unfortunately, in Dec 2020 it is still at a very early stage of development and downloading the data fails after getting around 400 items. To overcome this issue, I had to play around with the links generated with the approach involving `urllib` library and found a way to "crack" it to download only the images that I needed. The full dataset is 250GB and downloading it completely would take ages to complete. Using my custom approach, I managed to reduce the size of the data to only 323 MB. To do this, I firstly downloaded only the image bands that contain cloud coverage assessment values that say how probable it is that a p …