Raspberry Pi Hailo Bounding Boxes

Hey all :slight_smile: I would like to be able to modify the existing bounding boxes in the object_detection.py script, displaying my own artefacts for object recognition. I am looking in:

“hailo-rpi5-examples/venv_hailo_rpi_examples/python3.11/site-packages/hailo_apps/*”

But cannot find the code responsible for “drawing” these boxes. Can anyone point me in the right direction? Or is this happening at a lower-level in the code (C++ bindings)?

Any help appreciated : D

1 Like

Hey @Daniel304995 ,

I think our tutorial Getting Started with YOLO Object and Animal Recognition on the Raspberry Pi may be useful for this. The code we use for this section draws the box around the detected object and adds the text and score to the outline. You may be able to modify that example to display an artifact of your choice?

Hope this helps!

1 Like

Hey @Daniel304995,

Sorry to be the bearer of bad news, but I believe it is a difficult (if not impossible) thing to alter. I have previously dived into the pipelines and couldn’t find anything about drawing the bounding boxes, so it is either something tucked away deep within GStreamer (what the AI HAT uses to draw images and boxes), or it is something low-level in the library, like you said.

An alternative approach would be to build your own from scratch. You could pull the image that is being analysed, display it, then use OpenCV or Gstreamer to draw your own box around it or any of the artifacts you want, essentially creating a 2nd custom display window. Easier said than done, but still a possible alternative!

2 Likes

Great! Any advice for sending these frames (with artifcats) to an external display, and handling this 2nd window? I am slightly overwhelmed by the options.