KurtLin commited on
Commit
17191a0
·
1 Parent(s): 2b08595

Initial Commit

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -17,7 +17,6 @@ def get_coords(evt: gr.SelectData):
17
  return f"{evt.index[0]}, {evt.index[1]}"
18
 
19
  def inference(image, input_label):
20
- print(input_label)
21
  predictor.set_image(image)
22
  input_point = np.array([[int(input_label['label'].split(',')[0]), int(input_label['label'].split(',')[1])]])
23
  input_label = np.array([1])
@@ -39,11 +38,11 @@ with my_app:
39
  with gr.TabItem("Select your image"):
40
  with gr.Row():
41
  with gr.Column():
42
- img_source = gr.Image(label="Please select picture.", value='./images/truck.jpg', shape=(768, 768))
43
  coords = gr.Label(label="Image Coordinate")
44
  infer = gr.Button(label="Segment")
45
  with gr.Column():
46
- img_output = gr.Image(label="Output Mask")
47
 
48
  img_source.select(get_coords, [], coords)
49
  infer.click(
 
17
  return f"{evt.index[0]}, {evt.index[1]}"
18
 
19
  def inference(image, input_label):
 
20
  predictor.set_image(image)
21
  input_point = np.array([[int(input_label['label'].split(',')[0]), int(input_label['label'].split(',')[1])]])
22
  input_label = np.array([1])
 
38
  with gr.TabItem("Select your image"):
39
  with gr.Row():
40
  with gr.Column():
41
+ img_source = gr.Image(label="Please select picture.", value='./images/truck.jpg', shape=(1024, 1024))
42
  coords = gr.Label(label="Image Coordinate")
43
  infer = gr.Button(label="Segment")
44
  with gr.Column():
45
+ img_output = gr.Image(label="Output Mask", shape=(1024, 1024))
46
 
47
  img_source.select(get_coords, [], coords)
48
  infer.click(