yuragoithf commited on
Commit
f3bc543
·
1 Parent(s): b9c8f94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -52,7 +52,7 @@ 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)
@@ -62,7 +62,7 @@ def gen_pred(img=inputs, model=seg_model):
62
  img = tf.expand_dims(img, axis=0)
63
  pred = model.predict(img)
64
  pred = np.squeeze(pred, axis=0)
65
- return inputs, pred
66
 
67
 
68
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
 
52
  # outputs = gr.outputs.HTML() #uncomment for single class output
53
 
54
  def gen_pred(img=inputs, model=seg_model):
55
+ if img == None:
56
  img = cv2.imread('003e2c95d.jpg')
57
  #rgb_path = os.path.join(test_image_dir,img)
58
  #img = cv2.imread(rgb_path)
 
62
  img = tf.expand_dims(img, axis=0)
63
  pred = model.predict(img)
64
  pred = np.squeeze(pred, axis=0)
65
+ return img, pred
66
 
67
 
68
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"