Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,8 @@ def anylize(url):
|
|
27 |
|
28 |
# annotate
|
29 |
detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
|
30 |
-
labels = [
|
31 |
-
|
32 |
-
|
33 |
-
return frame
|
34 |
|
35 |
-
|
36 |
-
gr.Interface(fn = anylize, inputs="text", outputs=output).launch()
|
|
|
27 |
|
28 |
# annotate
|
29 |
detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
|
30 |
+
labels = [str([list(xyxy), confidence, id2label[class_id]]) for xyxy, _, confidence, class_id, _ in detections]
|
31 |
+
json_list = json.dumps(labels)
|
32 |
+
return json_list
|
|
|
33 |
|
34 |
+
gr.Interface(fn = anylize, inputs="text", outputs=gr.JSON()).launch()
|
|