230 - Semantic Segmentation of Landcover Dataset using U-Net

DigitalSreeni
DigitalSreeni
33.8 هزار بار بازدید - 3 سال پیش - Semantic Segmentation of Landcover Dataset
Semantic Segmentation of Landcover Dataset ​by loading images in batches from the drive​.

Code generated in the video can be downloaded from here:
https://github.com/bnsreenu/python_fo...

For all code:
https://github.com/bnsreenu/python_fo...

Dataset from: https://landcover.ai/
Labels:
0: Unlabeled background ​
1: Buildings​
2: Woodlands​
3: Water​

You can use any U-net but this code demonstrates the use of pre-trained encoder in the U-net - available as part of segmentation models library.

To install the segmentation models library: pip install -U segmentation-models

If you are running into generic_utils error when loading segmentation models library watch this video to fix it: Python tips and tricks - 6: Fixing ge....

Prepare the data first:
1. Read large images and corresponding masks, divide them into smaller patches. And write the patches as images to the local drive.  

2. Save only images and masks where masks have some decent amount of labels other than 0. Using blank images with label=0 is a waste of time and may bias the model towards unlabeled pixels.

3. Divide the sorted dataset from above into train and validation datasets.

4. You have to manually move some folders and rename them appropriately if you want to use ImageDataGenerator from keras.

After training, you can use the smooth blending process to segment large images.
3 سال پیش در تاریخ 1400/05/20 منتشر شده است.
33,873 بـار بازدید شده
... بیشتر