Martin Tomov commited on
Commit
4b03ffc
Β·
verified Β·
1 Parent(s): 20ec09a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -200,9 +200,9 @@ def process_image(image, include_json):
200
  json_output_path = "insect_detections.json"
201
  with open(json_output_path, 'w') as json_file:
202
  json.dump(detections_json, json_file, indent=4)
203
- return yellow_background_with_insects, json.dumps(detections_json, separators=(',', ':')), original_image, detections
204
  else:
205
- return yellow_background_with_insects, None, original_image, detections
206
 
207
  examples = [
208
  ["flower-night.jpg"]
@@ -211,7 +211,7 @@ examples = [
211
  gr.Interface(
212
  fn=process_image,
213
  inputs=[gr.Image(type="pil"), gr.Checkbox(label="Include JSON", value=False)],
214
- outputs=[gr.Image(type="numpy"), gr.Textbox(), gr.Image(type="numpy"), gr.JSON()],
215
  title="InsectSAM 🐞",
216
  examples=examples
217
- ).launch()
 
200
  json_output_path = "insect_detections.json"
201
  with open(json_output_path, 'w') as json_file:
202
  json.dump(detections_json, json_file, indent=4)
203
+ return yellow_background_with_insects, json.dumps(detections_json, separators=(',', ':'))
204
  else:
205
+ return yellow_background_with_insects, None
206
 
207
  examples = [
208
  ["flower-night.jpg"]
 
211
  gr.Interface(
212
  fn=process_image,
213
  inputs=[gr.Image(type="pil"), gr.Checkbox(label="Include JSON", value=False)],
214
+ outputs=[gr.Image(type="numpy"), gr.Textbox()],
215
  title="InsectSAM 🐞",
216
  examples=examples
217
+ ).launch()