Guy2 commited on
Commit
985c4f3
1 Parent(s): 137601a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -25,7 +25,7 @@ def anylize(img):
25
  # annotate
26
  detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
27
  labels = [str([list(xyxy), confidence, id2label[class_id]]) for xyxy, _, confidence, class_id, _ in detections]
28
- json_list = json.dumps(str(labels[0]))
29
  return json_list
30
 
31
  gr.Interface(fn = anylize, inputs="image", outputs=gr.JSON()).launch()
 
25
  # annotate
26
  detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
27
  labels = [str([list(xyxy), confidence, id2label[class_id]]) for xyxy, _, confidence, class_id, _ in detections]
28
+ json_list = json.dumps(labels)
29
  return json_list
30
 
31
  gr.Interface(fn = anylize, inputs="image", outputs=gr.JSON()).launch()