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}")
|
@@ -357,7 +357,7 @@ def resnet_50(name):
|
|
357 |
label_ = []
|
358 |
bboxes = []
|
359 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
360 |
-
box = [round(i,
|
361 |
print(
|
362 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
363 |
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, 1) for i in box.tolist()]
|
295 |
print(
|
296 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
297 |
+
f"{round(score.item(), 1)} 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, 1) 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}")
|
|
|
357 |
label_ = []
|
358 |
bboxes = []
|
359 |
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
360 |
+
box = [round(i, 1) for i in box.tolist()]
|
361 |
print(
|
362 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
363 |
f"{round(score.item(), 3)} at location {box}"
|