Martin Tomov commited on
Commit
3e44a16
·
verified ·
1 Parent(s): 8f4cd2e

adjustments to outputs in new demo

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -242,14 +242,18 @@ with gr.Blocks() as demo:
242
  return (annotated_img, json_txt, crops)
243
  elif include_bboxes:
244
  annotated_img, *crops = results
245
- return (annotated_img, None, crops)
 
246
  elif include_json:
247
- annotated_img, json_txt = results
248
- return (annotated_img, json_txt, [])
 
249
  else:
250
  annotated_img = results[0]
251
- return (annotated_img, None, [])
 
 
252
 
253
  submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
254
 
255
- demo.launch()
 
242
  return (annotated_img, json_txt, crops)
243
  elif include_bboxes:
244
  annotated_img, *crops = results
245
+ json_txt = None
246
+ return (annotated_img, json_txt, crops)
247
  elif include_json:
248
+ annotated_img, json_txt = results[:2]
249
+ crops = []
250
+ return (annotated_img, json_txt, crops)
251
  else:
252
  annotated_img = results[0]
253
+ json_txt = None
254
+ crops = []
255
+ return (annotated_img, json_txt, crops)
256
 
257
  submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
258
 
259
+ demo.launch(title="InsectSAM")