Spaces:
Runtime error
Runtime error
Commit ·
5516bb8
1
Parent(s): c1860c8
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def predict_bounding_boxes(imageurl:str):
|
|
| 21 |
outputs = box_model(**inputs)
|
| 22 |
|
| 23 |
target_sizes = torch.tensor([image_data.size[::-1]])
|
| 24 |
-
results = box_processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.
|
| 25 |
|
| 26 |
detections = [{"score": score.item(), "label": box_model.config.id2label[label.item()], "box": box.tolist()} for score, label, box in zip(results["scores"], results["labels"], results["boxes"])]
|
| 27 |
|
|
|
|
| 21 |
outputs = box_model(**inputs)
|
| 22 |
|
| 23 |
target_sizes = torch.tensor([image_data.size[::-1]])
|
| 24 |
+
results = box_processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.70)[0]
|
| 25 |
|
| 26 |
detections = [{"score": score.item(), "label": box_model.config.id2label[label.item()], "box": box.tolist()} for score, label, box in zip(results["scores"], results["labels"], results["boxes"])]
|
| 27 |
|