Guy2 commited on
Commit
1f00076
·
1 Parent(s): 891a723

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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()