Update app.py
Browse files
app.py
CHANGED
@@ -30,9 +30,9 @@ def response2(image: gr.Image = None,image_size: gr.Slider = 640, conf_threshold
|
|
30 |
|
31 |
text = ""
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
return render,text
|
38 |
|
|
|
30 |
|
31 |
text = ""
|
32 |
|
33 |
+
for score, label, box in zip(result.scores, result.labels, result.boxes):
|
34 |
+
box = [round(i, 2) for i in box.tolist()]
|
35 |
+
text += f"Detected {model.config.id2label[label.item()]} with confidence {round(score.item(), 3)} at location {box}\n"
|
36 |
|
37 |
return render,text
|
38 |
|