Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] imx500_object_detection_demo.py with nanodet: fails with ValueError #1164

Open
alexandre-perrin opened this issue Nov 15, 2024 · 0 comments

Comments

@alexandre-perrin
Copy link

Describe the bug

Running imx500_object_detection_demo.py on Raspberry Pi 5 with IMX500 camera with --postprocess nanodet fails with: ValueError: operands could not be broadcast together with shapes (1,0,4) (1,3598,1)

To Reproduce

On Raspberry Pi 5 with AI Camera:
execute the demo script with --postprocess nanodet option:

python imx500_object_detection_demo.py --postprocess nanodet

Expected behaviour

Camera starts and application keeps running without crash.

Console Output, Screenshots

Traceback (most recent call last):
  File "/home/alexandre/aitrios-sdk-edge-app-dev/sample_apps/detection/python/imx500_object_detection_demo.py", line 246, in <module>
    last_results = parse_detections(picam2.capture_metadata())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alexandre/aitrios-sdk-edge-app-dev/sample_apps/detection/python/imx500_object_detection_demo.py", line 40, in parse_detections
    boxes, scores, classes = postprocess_nanodet_detection(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/devices/imx500/postprocess_nanodet.py", line 38, in postprocess_nanodet_detection
    distances = x * anchors[..., 2, None]
                ~~^~~~~~~~~~~~~~~~~~~~~~~
ValueError: operands could not be broadcast together with shapes (1,0,4) (1,3598,1)

Hardware :

Raspberry Pi 5 with AI Camera IMX500

Additional context

@alexandre-perrin alexandre-perrin changed the title [BUG] [BUG] imx500_object_detection_demo.py nanodet: fails with ValueError Nov 15, 2024
@alexandre-perrin alexandre-perrin changed the title [BUG] imx500_object_detection_demo.py nanodet: fails with ValueError [BUG] imx500_object_detection_demo.py with nanodet: fails with ValueError Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant