yuragoithf commited on
Commit
55a937c
·
1 Parent(s): 00c13b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -59,7 +59,7 @@ image_output = gr.outputs.Image(type="pil", label="Output Image")
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
  # pil_image = Image.open('./003b50a15.jpg')
64
  # img = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2BGR)
65
  img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
@@ -72,8 +72,7 @@ def gen_pred(img=inputs, model=seg_model):
72
  # color_coverted = cv2.cvtColor(pred, cv2.COLOR_BGR2RGB)
73
  # pil_image = Image.fromarray(pred)
74
  PIL_image = Image.fromarray(pred.astype('uint8'), 'RGB')
75
- "UI in developing process ..."
76
- return PIL_image
77
 
78
 
79
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
@@ -82,7 +81,7 @@ description = "Upload an image and get prediction mask"
82
 
83
  gr.Interface(fn=gen_pred,
84
  inputs=inputs,
85
- outputs="image",
86
  title=title,
87
  examples=[["003e2c95d.jpg"], ["003b50a15.jpg"], ["003b48a9e.jpg"], ["0038cbe45.jpg"], ["00371aa92.jpg"]],
88
  # css=css_code,
 
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
  # pil_image = Image.open('./003b50a15.jpg')
64
  # img = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2BGR)
65
  img = img[::IMG_SCALING[0], ::IMG_SCALING[1]]
 
72
  # color_coverted = cv2.cvtColor(pred, cv2.COLOR_BGR2RGB)
73
  # pil_image = Image.fromarray(pred)
74
  PIL_image = Image.fromarray(pred.astype('uint8'), 'RGB')
75
+ return "UI in developing process ..."
 
76
 
77
 
78
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
 
81
 
82
  gr.Interface(fn=gen_pred,
83
  inputs=inputs,
84
+ outputs="text",
85
  title=title,
86
  examples=[["003e2c95d.jpg"], ["003b50a15.jpg"], ["003b48a9e.jpg"], ["0038cbe45.jpg"], ["00371aa92.jpg"]],
87
  # css=css_code,