Update app.py
Browse filesFixing the format issue
app.py
CHANGED
|
@@ -90,7 +90,7 @@ def detect_objects(model_name,url_input,image_input,threshold):
|
|
| 90 |
final_str = ""
|
| 91 |
for score, label, box in zip(processed_outputs["scores"], processed_outputs["labels"], processed_outputs["boxes"]):
|
| 92 |
box = [round(i, 2) for i in box.tolist()]
|
| 93 |
-
final_str += f"Detected {model.config.id2label[label.item()]} with confidence {score.item(), 3} at location {box}"
|
| 94 |
|
| 95 |
|
| 96 |
return viz_img, final_str
|
|
|
|
| 90 |
final_str = ""
|
| 91 |
for score, label, box in zip(processed_outputs["scores"], processed_outputs["labels"], processed_outputs["boxes"]):
|
| 92 |
box = [round(i, 2) for i in box.tolist()]
|
| 93 |
+
final_str += f"Detected `{model.config.id2label[label.item()]}` with confidence `{score.item(), 3}` at location `{box}`\n"
|
| 94 |
|
| 95 |
|
| 96 |
return viz_img, final_str
|