Closed dsnsabari closed 2 years ago
Hi @dsnsabari!
Please note that Detection
expects points
and scores
as np.ndarray
and you are actually using lists of np.ndarray
instead.
Based on your code, something like this should work:
boxes, scores, classes, num = SSDEfficienet(image)
norfair_detections = []
for row in range(len(boxes)):
if classes[row]=="person":
box_value = np.array(
[
[boxes[row][0], boxes[row][1]],
[boxes[row][2], boxes[row][3]],
]
)
score_value = np.array(
[scores[row], scores[row]]
)
norfair_detections.append(
Detection(
points=box_value, scores=score_value, label=int(2)
)
)
You can also check the documentation for more specific details on the Detection
class.
@facundo-lezama Thank you. It is working now.
When I checked the Yolo v7 demo codes . It uses a bounding box or centre point for tracking. I want to use the SSD object coordinates( xmin,ymin,xmax,ymax) for tracking. If I pass the coordinates in the below format, I am getting an error. The below box structure is (xmin,ymin,xmax,ymax). Could you help me fixing the issue
reference script: https://github.com/tryolabs/norfair/blob/master/demos/yolov7/src/demo.py