Spaces:
Sleeping
Sleeping
clean up
Browse files
app.py
CHANGED
|
@@ -80,15 +80,13 @@ def streaming_object_detection(recording_id: str, img):
|
|
| 80 |
outputs = model(**inputs)
|
| 81 |
|
| 82 |
# convert outputs (bounding boxes and class logits) to COCO API
|
| 83 |
-
# let's only keep detections with score > 0.
|
| 84 |
-
|
| 85 |
height, width = img.shape[:2]
|
| 86 |
target_sizes = torch.tensor([[height, width]]) # [height, width] order
|
| 87 |
results = processor.post_process_object_detection(
|
| 88 |
-
outputs, target_sizes=target_sizes, threshold=0.
|
| 89 |
)[0]
|
| 90 |
|
| 91 |
-
print(results)
|
| 92 |
rec.log(
|
| 93 |
"image/objects",
|
| 94 |
rr.Boxes2D(
|
|
|
|
| 80 |
outputs = model(**inputs)
|
| 81 |
|
| 82 |
# convert outputs (bounding boxes and class logits) to COCO API
|
| 83 |
+
# let's only keep detections with score > 0.85
|
|
|
|
| 84 |
height, width = img.shape[:2]
|
| 85 |
target_sizes = torch.tensor([[height, width]]) # [height, width] order
|
| 86 |
results = processor.post_process_object_detection(
|
| 87 |
+
outputs, target_sizes=target_sizes, threshold=0.85
|
| 88 |
)[0]
|
| 89 |
|
|
|
|
| 90 |
rec.log(
|
| 91 |
"image/objects",
|
| 92 |
rr.Boxes2D(
|