Skip to content

Commit ad54de4

Browse files
committed
more numpy array boxes fix
1 parent 1db18d6 commit ad54de4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vision/workflow-test/detector_rewrite_live.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def initialize_camera_params(zed, input_type):
4646
def main():
4747
parser = argparse.ArgumentParser()
4848
parser.add_argument(
49-
"--weights", type=str, default="yolov8m.pt", help="Path to YOLO model weights."
49+
"--weights", type=str, default="yolov11n.pt", help="Path to YOLO model weights."
5050
)
5151
parser.add_argument("--svo", type=str, required=True, help="Path to the SVO file.")
5252
parser.add_argument(
@@ -88,15 +88,15 @@ def main():
8888

8989
# YOLO detection
9090
results = model.predict(img, save=False, conf=conf, iou=iou)
91-
detections = results[0].boxes # .cpu().numpy()?
91+
detections = results[0].boxes.cpu().numpy()
9292

9393
objects_in = []
9494
for box in detections:
9595
tmp = sl.CustomBoxObjectData()
9696
tmp.unique_object_id = sl.generate_unique_id()
97-
tmp.probability = box.conf
98-
tmp.label = int(box.cls)
99-
tmp.bounding_box_2d = box.xyxy.cpu().numpy()
97+
tmp.probability = box.conf[0].item()
98+
tmp.label = int(box.cls[0].item())
99+
tmp.bounding_box_2d = box.xyxy[0].item()
100100
tmp.is_grounded = True
101101
objects_in.append(tmp)
102102

0 commit comments

Comments
 (0)