Martin Tomov commited on
Commit
9a834bb
·
verified ·
1 Parent(s): 4d7b04d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -183,7 +183,7 @@ def detections_to_json(detections):
183
  "xmin": detection.box.xmin,
184
  "ymin": detection.box.ymin,
185
  "xmax": detection.box.xmax,
186
- "ymax": detection.box.ymax
187
  },
188
  "mask": run_length_encoding(detection.mask) if detection.mask is not None else None
189
  }
@@ -256,6 +256,7 @@ with gr.Blocks(css=css) as demo:
256
  with gr.Column():
257
  include_json = gr.Checkbox(label="Include JSON", value=False, elem_id="checkbox-group")
258
  include_bboxes = gr.Checkbox(label="Include Bounding Boxes", value=False, elem_id="checkbox-group")
 
259
  submit_button = gr.Button("Submit", elem_id="submit-button")
260
 
261
  annotated_output = gr.Image(type="numpy")
@@ -279,6 +280,4 @@ with gr.Blocks(css=css) as demo:
279
 
280
  submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
281
 
282
- gr.Examples(examples=examples, inputs=[image_input, include_json, include_bboxes])
283
-
284
- demo.launch()
 
183
  "xmin": detection.box.xmin,
184
  "ymin": detection.box.ymin,
185
  "xmax": detection.box.xmax,
186
+ "ymax": detection.box.xmax
187
  },
188
  "mask": run_length_encoding(detection.mask) if detection.mask is not None else None
189
  }
 
256
  with gr.Column():
257
  include_json = gr.Checkbox(label="Include JSON", value=False, elem_id="checkbox-group")
258
  include_bboxes = gr.Checkbox(label="Include Bounding Boxes", value=False, elem_id="checkbox-group")
259
+ gr.Examples(examples=examples, inputs=[image_input, include_json, include_bboxes])
260
  submit_button = gr.Button("Submit", elem_id="submit-button")
261
 
262
  annotated_output = gr.Image(type="numpy")
 
280
 
281
  submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
282
 
283
+ demo.launch()