Semantic segmentation of the Multi-Source Satellite Imagery for Segmentation Dataset with UNet and ResUNet-a in PyTorch, with graphical interface in Streamlit.
Install all dependencies
pip install -r requirements.txt
Run the app locally using this command to see the segmentation results.
python -m streamlit run app.py
Use the augment
method in the dataset class to create randomly cropped, flipped and color changed images.
Change the dataset initialization to the following code in the notebook and run all the cells to re-train the models.
dataset = SatelliteImageDataset(
image_dir='data/images',mask_dir='data/masks',
)
dataset.augment(dest_image_dir='data/augmented_images', dest_mask_dir='data/augmented_masks')
The augment
method only has to be executed once. Use this command if you would want to load the dataset in different files.
dataset = SatelliteImageDataset(
image_dir='data/images',
mask_dir='data/masks',
aug_image_dir='data/augmented_images',
aug_mask_dir='data/augmented_masks'
)
- Sharpen
transforms.functional.adjust_sharpness(image, 2)
- Increased saturation
transforms.ColorJitter(contrast=(1.25, 1.25))
Multi-Source Satellite Imagery for Segmentation on Kaggle
ResUNet-a: a deep learning framework for semantic segmentation of remotely sensed data by Foivos I. Diakogiannis, François Waldner, Peter Caccetta & Chen Wu
U-Net: Convolutional Networks for Biomedical Image Segmentation by Olaf Ronneberger, Philipp Fischer & Thomas Brox