Spaces:
Sleeping
Sleeping
Add article to demo
Browse files- .gitattributes +1 -0
- app.py +13 -6
- article.md +29 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -101,20 +101,27 @@ def segment(satellite_image: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
|
|
| 101 |
return raw_segmentation, segmentation_overlay
|
| 102 |
|
| 103 |
|
| 104 |
-
|
| 105 |
-
|
| 106 |
images_dir = "sample_sat_images/"
|
| 107 |
examples = [f"{images_dir}/{image_id}" for image_id in os.listdir(images_dir)]
|
| 108 |
-
title = "Satellite Images Landcover
|
| 109 |
-
description =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
iface = gr.Interface(
|
| 112 |
segment,
|
| 113 |
-
|
| 114 |
-
|
| 115 |
examples=examples,
|
| 116 |
title=title,
|
| 117 |
description=description,
|
| 118 |
cache_examples=True,
|
|
|
|
| 119 |
)
|
| 120 |
iface.launch()
|
|
|
|
| 101 |
return raw_segmentation, segmentation_overlay
|
| 102 |
|
| 103 |
|
| 104 |
+
inputs = gr.inputs.Image(label="Input Image")
|
| 105 |
+
outputs = [gr.Image(label="Raw Segmentation"), gr.Image(label="Segmentation Overlay")]
|
| 106 |
images_dir = "sample_sat_images/"
|
| 107 |
examples = [f"{images_dir}/{image_id}" for image_id in os.listdir(images_dir)]
|
| 108 |
+
title = "Satellite Images Landcover Classification"
|
| 109 |
+
description = (
|
| 110 |
+
"Upload a satellite image from your computer or select one from"
|
| 111 |
+
" the examples to automatically. The model will segment the landcover"
|
| 112 |
+
" types from a preselected set of possible types."
|
| 113 |
+
)
|
| 114 |
+
article = open("article.md", "r").read()
|
| 115 |
+
|
| 116 |
|
| 117 |
iface = gr.Interface(
|
| 118 |
segment,
|
| 119 |
+
inputs,
|
| 120 |
+
outputs,
|
| 121 |
examples=examples,
|
| 122 |
title=title,
|
| 123 |
description=description,
|
| 124 |
cache_examples=True,
|
| 125 |
+
article=article,
|
| 126 |
)
|
| 127 |
iface.launch()
|
article.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## **Problem statement**
|
| 2 |
+
|
| 3 |
+
The objective of this task is to classify different landcover types in a satellite image. This problem is approached as a machine learning task known as semantic segmentation, where the goal is to predict the class label for each individual pixel in the image.
|
| 4 |
+
|
| 5 |
+
## **Dataset**
|
| 6 |
+
The [dataset](https://www.kaggle.com/datasets/balraj98/deepglobe-land-cover-classification-dataset) used for this project is from the 2018 DeepGlobe Landcover Classification Challenge. It consists of a total of 803 satellite images, each with dimensions of 2448x2448 pixels. Each image in the dataset is accompanied by a segmentation mask that assigns class labels to the pixels.
|
| 7 |
+
|
| 8 |
+
| Landcover Name | Color | Explanation / Function |
|
| 9 |
+
| -------------------- | ------------------------ | ------------------------------------------------------------ |
|
| 10 |
+
| Urban land | <span style="color:cyan">Cyan</span> | Man-made, built-up areas with human artifacts |
|
| 11 |
+
| Agriculture land | <span style="color:yellow">Yellow</span> | Farms, planned plantations, cropland, orchards |
|
| 12 |
+
| Rangeland | <span style="color:magenta">Magenta</span> | Non-forest, non-farm, green land, grass |
|
| 13 |
+
| Forest land | <span style="color:green">Green</span> | Land with at least 20% tree crown density and clear cuts |
|
| 14 |
+
| Water | <span style="color:blue">Blue</span> | Rivers, oceans, lakes, wetlands, ponds |
|
| 15 |
+
| Barren land | <span style="color:gray">White</span> | Mountains, rocks, deserts, beaches, vegetation-free land |
|
| 16 |
+
| Unknown | <span style="color:black">Black</span> | Clouds and others |
|
| 17 |
+
|
| 18 |
+
## **Model**
|
| 19 |
+
For this task, we utilized a pre-trained UNet model with weights pretrained on the ImageNet dataset. We then fine-tuned the UNet using the DeepGlobe Landcover Classification dataset. The training process took approximately 2 hours using a single NVIDIA T4 GPU.
|
| 20 |
+
## **Team members**
|
| 21 |
+
David Mora
|
| 22 |
+
|
| 23 |
+
Eduard's Mendez
|
| 24 |
+
|
| 25 |
+
Santiago Ahumada
|
| 26 |
+
|
| 27 |
+
## **Aditional information**
|
| 28 |
+
|
| 29 |
+
If you are interested in contributing to the project or just getting more information about the details you can head over to our GitHub [repository](https://github.com/DavidFM43/landcover-segmentation).
|