Update app.py
Browse files
app.py
CHANGED
|
@@ -147,6 +147,18 @@ def predict_on_test(image):
|
|
| 147 |
|
| 148 |
sample_images = get_sample_images('example_images')
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
# Launch Gradio Interface (Single Tab interface)
|
| 151 |
# gr.Interface(
|
| 152 |
# predict,
|
|
@@ -161,6 +173,7 @@ tab1 = gr.Interface(
|
|
| 161 |
inputs=gr.Image(),
|
| 162 |
outputs=[gr.Image(), gr.Image()],
|
| 163 |
title='Images with Ground Truth',
|
|
|
|
| 164 |
examples=sample_images
|
| 165 |
)
|
| 166 |
|
|
@@ -170,24 +183,14 @@ tab2 = gr.Interface(
|
|
| 170 |
inputs=gr.Image(),
|
| 171 |
outputs=gr.Image(),
|
| 172 |
title='Images with Ground Truth',
|
|
|
|
| 173 |
examples=sample_images
|
| 174 |
)
|
| 175 |
|
| 176 |
# Create a Multi Interface with Tabs
|
| 177 |
iface = gr.TabbedInterface([tab1, tab2],
|
| 178 |
title='Land Cover Segmentation',
|
| 179 |
-
|
| 180 |
-
'''
|
| 181 |
-
The DeepGlobe Land Cover Classification Challenge offers the first public dataset containing high resolution
|
| 182 |
-
satellite imagery focusing on rural areas. As there are multiple land cover types and high density of annotations,
|
| 183 |
-
this dataset is more challenging than its counterparts launched in 2018. All satellite images contain RGB pixels,
|
| 184 |
-
with a pixel resolution of 50 cm. The total size of the total area of the dataset is equivalent to 10716.9 square kilometers.
|
| 185 |
-
|
| 186 |
-
We trained on 803 images and their segmentation masks (with split of 80/20%). For this multilabel segmentation task, we trained 4 models,
|
| 187 |
-
the basic 4-blocks U-net CNN, VGG16 U-Net, Resnet50 U-net and Efficient Net U-net. Then, I built an ensemble model that achieved a
|
| 188 |
-
validation accuracy of about 75% and dice score of about 0.6.
|
| 189 |
-
''',
|
| 190 |
-
tab_names = ['Train','Test'])
|
| 191 |
|
| 192 |
# Launch the interface
|
| 193 |
iface.launch(share=True)
|
|
|
|
| 147 |
|
| 148 |
sample_images = get_sample_images('example_images')
|
| 149 |
|
| 150 |
+
description=
|
| 151 |
+
'''
|
| 152 |
+
The DeepGlobe Land Cover Classification Challenge offers the first public dataset containing high resolution
|
| 153 |
+
satellite imagery focusing on rural areas. As there are multiple land cover types and high density of annotations,
|
| 154 |
+
this dataset is more challenging than its counterparts launched in 2018. All satellite images contain RGB pixels,
|
| 155 |
+
with a pixel resolution of 50 cm. The total size of the total area of the dataset is equivalent to 10716.9 square kilometers.
|
| 156 |
+
|
| 157 |
+
We trained on 803 images and their segmentation masks (with split of 80/20%). For this multilabel segmentation task, we trained 4 models,
|
| 158 |
+
the basic 4-blocks U-net CNN, VGG16 U-Net, Resnet50 U-net and Efficient Net U-net. Then, I built an ensemble model that achieved a
|
| 159 |
+
validation accuracy of about 75% and dice score of about 0.6.
|
| 160 |
+
'''
|
| 161 |
+
|
| 162 |
# Launch Gradio Interface (Single Tab interface)
|
| 163 |
# gr.Interface(
|
| 164 |
# predict,
|
|
|
|
| 173 |
inputs=gr.Image(),
|
| 174 |
outputs=[gr.Image(), gr.Image()],
|
| 175 |
title='Images with Ground Truth',
|
| 176 |
+
description=description,
|
| 177 |
examples=sample_images
|
| 178 |
)
|
| 179 |
|
|
|
|
| 183 |
inputs=gr.Image(),
|
| 184 |
outputs=gr.Image(),
|
| 185 |
title='Images with Ground Truth',
|
| 186 |
+
description=description,
|
| 187 |
examples=sample_images
|
| 188 |
)
|
| 189 |
|
| 190 |
# Create a Multi Interface with Tabs
|
| 191 |
iface = gr.TabbedInterface([tab1, tab2],
|
| 192 |
title='Land Cover Segmentation',
|
| 193 |
+
tab_names = ['Train','Test'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
# Launch the interface
|
| 196 |
iface.launch(share=True)
|