I am running the hailo-CLIP examples. Now I would like to mark detected objects with a bounding box, in a similar way as it is done in the hailo-rpi5-examples.
In the file clip_application.py
the bounding box coordinates appear to be determined for every detection:
# Parse the detections
for detection in detections:
track = detection.get_objects_typed(hailo.HAILO_UNIQUE_ID)
track_id = None
label = None
confidence = 0.0
for track_id_obj in track:
track_id = track_id_obj.get_id()
if track_id is not None:
string_to_print += f'Track ID: {track_id} '
classifications = detection.get_objects_typed(hailo.HAILO_CLASSIFICATION)
if len(classifications) > 0:
string_to_print += ' CLIP Classifications:'
for classification in classifications:
label = classification.get_label()
confidence = classification.get_confidence()
string_to_print += f'Label: {label} Confidence: {confidence:.2f} '
string_to_print += '\n'
if isinstance(detection, hailo.HailoDetection):
label = detection.get_label()
**bbox = detection.get_bbox()**
confidence = detection.get_confidence()
string_to_print += f"Detection: {label} {confidence:.2f}\n"
if string_to_print:
print(string_to_print)
return Gst.PadProbeReturn.OK
how can I now draw the box with the retrieved coordinates for bbox
?
Thanks for your support!