Commit
·
51439bf
1
Parent(s):
4e2e389
Update app.py
Browse files
app.py
CHANGED
@@ -53,13 +53,13 @@ def dice_coef(y_true, y_pred, smooth=1):
|
|
53 |
seg_model = tf.keras.models.load_model('seg_unet_model.h5', custom_objects={'Combo_loss': Combo_loss, 'dice_coef': dice_coef})
|
54 |
|
55 |
inputs = gr.inputs.Image(type="pil", label="Upload an image", source="upload")
|
56 |
-
inputs = get_opencv_img_from_buffer(inputs)
|
57 |
image_output = gr.outputs.Image(type="pil", label="Output Image")
|
58 |
# outputs = gr.outputs.HTML() #uncomment for single class output
|
59 |
|
60 |
def gen_pred(img=inputs, model=seg_model):
|
61 |
-
#rgb_path = os.path.join(test_image_dir,img)
|
62 |
-
#img = cv2.imread(rgb_path)
|
|
|
63 |
img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
|
64 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
65 |
img = img/255
|
|
|
53 |
seg_model = tf.keras.models.load_model('seg_unet_model.h5', custom_objects={'Combo_loss': Combo_loss, 'dice_coef': dice_coef})
|
54 |
|
55 |
inputs = gr.inputs.Image(type="pil", label="Upload an image", source="upload")
|
|
|
56 |
image_output = gr.outputs.Image(type="pil", label="Output Image")
|
57 |
# outputs = gr.outputs.HTML() #uncomment for single class output
|
58 |
|
59 |
def gen_pred(img=inputs, model=seg_model):
|
60 |
+
# rgb_path = os.path.join(test_image_dir,img)
|
61 |
+
# img = cv2.imread(rgb_path)
|
62 |
+
img = cv2.imread("./003e2c95d.jpg")
|
63 |
img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
|
64 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
65 |
img = img/255
|