Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Camera board • YOLOv8 Model Works in Python (picamera2) but Not in C++ (rpicam) – Bounding Box Drawing Issue

$
0
0
I trained a YOLOv8n model using Ultralytics(https://docs.ultralytics.com/integratio ... o11-models) and deployed it on an iMX500. The model works correctly in Python (using `picamera2`), detecting objects and drawing bounding boxes as expected. However, when I run the same model in C++ (using `rpicam`), the detections appear to be happening (confirmed via logs), but the bounding boxes are not drawn correctly—i checked the x, y, width and height, basically x and y are getting extremely high values (between 1000-60000) when the image is 1024x512 while width and height remain 0 . Pre-trained models from (https://github.com/raspberrypi/imx500-models)work in C++ but not Python, while my custom model works in Python but not C++. Has anyone encountered this? How can I fix it?

Here is a example of logs from Custom model:
person[0] (0.5) @ 128992,1406 0x0

And here is a example from normal models:
person[0] (0.5) @ 71,72 943x439

Statistics: Posted by aa006 — Wed Jun 25, 2025 8:55 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles