Commit
·
b9c8f94
1
Parent(s):
78af2c8
Update app.py
Browse files
app.py
CHANGED
@@ -48,14 +48,12 @@ def dice_coef(y_true, y_pred, smooth=1):
|
|
48 |
# Load the model
|
49 |
seg_model = tf.keras.models.load_model('seg_unet_model.h5', custom_objects={'Combo_loss': Combo_loss, 'dice_coef': dice_coef})
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
inputs = gr.inputs.Image(type="pil", label="Upload an image")
|
56 |
# outputs = gr.outputs.HTML() #uncomment for single class output
|
57 |
|
58 |
def gen_pred(img=inputs, model=seg_model):
|
|
|
|
|
59 |
#rgb_path = os.path.join(test_image_dir,img)
|
60 |
#img = cv2.imread(rgb_path)
|
61 |
img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
|
|
|
48 |
# Load the model
|
49 |
seg_model = tf.keras.models.load_model('seg_unet_model.h5', custom_objects={'Combo_loss': Combo_loss, 'dice_coef': dice_coef})
|
50 |
|
|
|
|
|
|
|
|
|
51 |
inputs = gr.inputs.Image(type="pil", label="Upload an image")
|
52 |
# outputs = gr.outputs.HTML() #uncomment for single class output
|
53 |
|
54 |
def gen_pred(img=inputs, model=seg_model):
|
55 |
+
if !img:
|
56 |
+
img = cv2.imread('003e2c95d.jpg')
|
57 |
#rgb_path = os.path.join(test_image_dir,img)
|
58 |
#img = cv2.imread(rgb_path)
|
59 |
img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
|