Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ if submit:
|
|
| 59 |
target_sizes = torch.tensor([image.size[::-1]])
|
| 60 |
results = processor.post_process_object_detection(outputs, threshold=0.9, target_sizes=target_sizes)[0]
|
| 61 |
# prettify_results(results)
|
| 62 |
-
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
| 63 |
box = [round(i, 2) for i in box.tolist()]
|
| 64 |
st.write(
|
| 65 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|
|
|
|
| 59 |
target_sizes = torch.tensor([image.size[::-1]])
|
| 60 |
results = processor.post_process_object_detection(outputs, threshold=0.9, target_sizes=target_sizes)[0]
|
| 61 |
# prettify_results(results)
|
| 62 |
+
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
| 63 |
box = [round(i, 2) for i in box.tolist()]
|
| 64 |
st.write(
|
| 65 |
f"Detected {model.config.id2label[label.item()]} with confidence "
|