Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,5 +24,7 @@ def anylize(img):
|
|
24 |
detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
|
25 |
labels = [str([list(xyxy), confidence, id2label[class_id]]) for xyxy, _, confidence, class_id, _ in detections]
|
26 |
json_list = json.dumps(str(labels[0]))
|
|
|
27 |
|
|
|
28 |
gr.Interface.load("models/Guy2/AirportSec-100epoch").launch()
|
|
|
24 |
detections = sv.Detections.from_transformers(transformers_results=results).with_nms(threshold=0.5)
|
25 |
labels = [str([list(xyxy), confidence, id2label[class_id]]) for xyxy, _, confidence, class_id, _ in detections]
|
26 |
json_list = json.dumps(str(labels[0]))
|
27 |
+
return json_list
|
28 |
|
29 |
+
gr.Interface(fn = anylize, inputs="image", outputs=gr.JSON()).launch()
|
30 |
gr.Interface.load("models/Guy2/AirportSec-100epoch").launch()
|