Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
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()
|