Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -291,10 +291,10 @@ def yolo_tiny(name):
|
|
291 |
bboxes = []
|
292 |
|
293 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
294 |
-
box = [round(i,
|
295 |
print(
|
296 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
297 |
-
f"{round(score.item(),
|
298 |
)
|
299 |
|
300 |
label_.append(model.config.id2label[label.item()])
|
@@ -323,7 +323,7 @@ def resnet_101(name):
|
|
323 |
label_ = []
|
324 |
bboxes = []
|
325 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
326 |
-
box = [round(i,
|
327 |
print(
|
328 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
329 |
f"{round(score.item(), 3)} at location {box}")
|
|
|
291 |
bboxes = []
|
292 |
|
293 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
294 |
+
box = [round(i, 12) for i in box.tolist()]
|
295 |
print(
|
296 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
297 |
+
f"{round(score.item(), 12)} at location {box}"
|
298 |
)
|
299 |
|
300 |
label_.append(model.config.id2label[label.item()])
|
|
|
323 |
label_ = []
|
324 |
bboxes = []
|
325 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
326 |
+
box = [round(i, 12) for i in box.tolist()]
|
327 |
print(
|
328 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
329 |
f"{round(score.item(), 3)} at location {box}")
|