yuragoithf
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ IMG_SCALING = (1, 1)
|
|
22 |
# return output
|
23 |
|
24 |
#model_file = "./seg_unet_model.h5"
|
25 |
-
model_file =
|
26 |
|
27 |
#Custom objects for model
|
28 |
|
@@ -51,7 +51,7 @@ def focal_loss_fixed(y_true, y_pred, gamma=2.0, alpha=0.25):
|
|
51 |
return focal_loss_fixed
|
52 |
|
53 |
# Load the model
|
54 |
-
seg_model = keras.models.load_model(
|
55 |
|
56 |
# inputs = gr.inputs.Image(type="pil", label="Upload an image")
|
57 |
# image_output = gr.outputs.Image(type="pil", label="Output Image")
|
|
|
22 |
# return output
|
23 |
|
24 |
#model_file = "./seg_unet_model.h5"
|
25 |
+
model_file = 'seg_unet_model.h5'
|
26 |
|
27 |
#Custom objects for model
|
28 |
|
|
|
51 |
return focal_loss_fixed
|
52 |
|
53 |
# Load the model
|
54 |
+
seg_model = keras.models.load_model(model_file, custom_objects={'Combo_loss': Combo_loss, 'focal_loss_fixed': focal_loss_fixed, 'dice_coef': dice_coef})
|
55 |
|
56 |
# inputs = gr.inputs.Image(type="pil", label="Upload an image")
|
57 |
# image_output = gr.outputs.Image(type="pil", label="Output Image")
|