Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ def response2(image: gr.Image = None,image_size: gr.Slider = 640, conf_threshold
|
|
| 36 |
# # im_rgb = Image.fromarray(im_rgb)
|
| 37 |
text = ""
|
| 38 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
| 39 |
-
|
| 40 |
|
| 41 |
text = text + (f"Detected {model.config.id2label[label.item()]} with confidence, {round(score.item(), 3)} at location {box}")
|
| 42 |
|
|
|
|
| 36 |
# # im_rgb = Image.fromarray(im_rgb)
|
| 37 |
text = ""
|
| 38 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
| 39 |
+
box = [round(i, 2) for i in box.tolist()]
|
| 40 |
|
| 41 |
text = text + (f"Detected {model.config.id2label[label.item()]} with confidence, {round(score.item(), 3)} at location {box}")
|
| 42 |
|