Mismatching color channel order in Hailo detect example

Open
#1,148 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with examples/hailo/detect.py and inspect how the lores stream format is passed to hailo.run(). Compare RGB888 and BGR888 using the orange image and verify which channel order the Hailo example expects. Done means the example uses the correct format or clearly documents the required order, with object detection behaving correctly.

Written by the indexing model from the issue text.

Description

While running object detection example for Hailo (examples/hailo/detect.py) with the image of an orange, it detects it somewhat poorly, detecting only a vase sometimes:

20241030_19h56m55s_grim

When I changed the format in lores to BGR888 instead of RGB888, it detects an orange very nicely (which it wouldn't if the BGR format was incorrect, because the orange would be blue):

20241030_19h57m43s_grim

I can only conclude that hailo.run() or models themselves expect the image in the BGR888 format instead of RGB888. Is that correct?

Hardware :
Raspberry Pi 5 8GB with Arducam IMX708 B0310

Dominant language
Python
Stars
1.2k
Forks
258
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picamera2

All issues in raspberrypi/picamera2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.