Skip to content

Commit eca0e83

Browse files
committed
fixed box truth value
1 parent 8451809 commit eca0e83

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vision/workflow-test/detector_rewrite_live.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from email.mime import image
12
import sys
23
import numpy as np
34
import json
@@ -10,6 +11,9 @@
1011
from threading import Lock, Thread
1112
from time import sleep
1213

14+
import ogl_viewer.viewer as gl
15+
import cv_viewer.tracking_viewer as cv_viewer
16+
1317

1418
def initialize_camera_params(zed, input_type):
1519
init_params = sl.InitParameters(
@@ -123,7 +127,7 @@ def main():
123127
tmp.unique_object_id = sl.generate_unique_id()
124128
tmp.probability = box.conf.item() # what if array is bigger than 1?
125129
tmp.label = int(box.cls.item())
126-
tmp.bounding_box_2d = xywh2abcd(box.xywh[0], image_net)
130+
tmp.bounding_box_2d = xywh2abcd(box.xywh[0], image_net.shape)
127131
tmp.is_grounded = True
128132
objects_in.append(tmp)
129133

@@ -141,7 +145,7 @@ def main():
141145
# Draw 3D bounding box
142146
for obj in objects.object_list:
143147
bbox = obj.bounding_box
144-
if bbox:
148+
if bbox.any():
145149
for i in range(4):
146150
start = (int(bbox[i][0]), int(bbox[i][1]))
147151
end = (int(bbox[(i + 1) % 4][0]), int(bbox[(i + 1) % 4][1]))

0 commit comments

Comments
 (0)