Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,9 +24,7 @@ dice_loss = sm.losses.DiceLoss(class_weights = weights)
|
|
| 24 |
focal_loss = sm.losses.CategoricalFocalLoss()
|
| 25 |
total_loss = dice_loss + (1 * focal_loss)
|
| 26 |
|
| 27 |
-
satellite_model = load_model('model/
|
| 28 |
-
custom_objects=({'dice_loss_plus_1focal_loss': total_loss,|'jaccard_coef': jaccard_coef}))
|
| 29 |
-
|
| 30 |
|
| 31 |
def process_input_image(image_source):
|
| 32 |
image = np.expand_dims(image_source, 0)
|
|
@@ -43,7 +41,7 @@ my_app = gr.Blocks()
|
|
| 43 |
with my_app:
|
| 44 |
gr.Markdown("Statellite Image Segmentation Application UI with Gradio")
|
| 45 |
with gr.Tabs():
|
| 46 |
-
with gr.TabItem("Select your image"):
|
| 47 |
with gr.Row():
|
| 48 |
with gr.Column():
|
| 49 |
img_source = gr.Image(label="Please select source Image", shape=(256, 256))
|
|
|
|
| 24 |
focal_loss = sm.losses.CategoricalFocalLoss()
|
| 25 |
total_loss = dice_loss + (1 * focal_loss)
|
| 26 |
|
| 27 |
+
satellite_model = load_model('model/satellite_segmentation_full.h5',custom_objects=({'dice_loss_plus_1focal_loss': total_loss,|'jaccard_coef': jaccard_coef}))
|
|
|
|
|
|
|
| 28 |
|
| 29 |
def process_input_image(image_source):
|
| 30 |
image = np.expand_dims(image_source, 0)
|
|
|
|
| 41 |
with my_app:
|
| 42 |
gr.Markdown("Statellite Image Segmentation Application UI with Gradio")
|
| 43 |
with gr.Tabs():
|
| 44 |
+
with gr.TabItem ("Select your image"):
|
| 45 |
with gr.Row():
|
| 46 |
with gr.Column():
|
| 47 |
img_source = gr.Image(label="Please select source Image", shape=(256, 256))
|