Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,14 +19,13 @@ def jaccard_coef(y_true, y_pred):
|
|
| 19 |
final_coef_value = (intersection + 1.0) / (K.sum(y_true_flatten) + K.sum(y_pred_flatten) - intersection + 1.0)
|
| 20 |
return final_coef_value
|
| 21 |
|
| 22 |
-
weights = [0.2,0.2,0.2,0.2,0.2]
|
| 23 |
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('C:/Users/sa/Desktop/Model_Training/satellite_segmentation_full.h5',
|
| 28 |
-
custom_objects=({'dice_loss_plus_1focal_loss': total_loss,
|
| 29 |
-
'jaccard_coef': jaccard_coef}))
|
| 30 |
|
| 31 |
|
| 32 |
def process_input_image(image_source):
|
|
|
|
| 19 |
final_coef_value = (intersection + 1.0) / (K.sum(y_true_flatten) + K.sum(y_pred_flatten) - intersection + 1.0)
|
| 20 |
return final_coef_value
|
| 21 |
|
| 22 |
+
weights = [0.2,0.2,0.2,0.2,0.2]
|
| 23 |
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/C:/Users/sa/Desktop/Model_Training/satellite_segmentation_full.h5',
|
| 28 |
+
custom_objects=({'dice_loss_plus_1focal_loss': total_loss,'jaccard_coef': jaccard_coef}))
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
def process_input_image(image_source):
|