How to run a custom YOLOv11 model on Rubik Pi?

Hi, I’m trying to run a custom-trained YOLOv11n model (quantized and exported to TFLite via Qualcomm AI Hub) on Rubik Pi 3, using live camera input.

I was able to run the official demo models without issue by placing the contents of the RUBIKPi_models folder into /opt/ and executing the provided sample pipelines — camera streaming and object detection worked as expected.

However, when I attempt to use my own quantized YOLOv11n TFLite model, the pipeline fails and nothing is rendered on the display.

Here is the command I used:

gst-launch-1.0 -e \
  qtiqmmfsrc camera=0 ! \
  'video/x-raw(memory:GBM),format=NV12,width=640,height=480,framerate=30/1' ! queue ! \
  qtimlvconverter ! queue ! \
  qtimltflite \
    delegate=external \
    external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" \
    model=/opt/RUBIKPi_models/yolov11n_int8.tflite ! queue ! \
  qtimlvdetection \
    threshold=50 \
    results=10 \
    module=yolov5 \
    constants="YoloV5,q-offsets=<0.0>,q-scales=<0.003921568627>" \
    labels=/opt/RUBIKPi_models/yolov11n_int8.labels ! queue ! \
  qtivcomposer name=mix sink_0::alpha=0.8 ! \
  waylandsink sync=false

This gives a caps negotiation error from qtimlvdetection.
My model outputs include tensors like boxes: [1, 8400, 4], scores: [1, 8400], and class_idx: [1, 8400], with quantization applied.

:red_question_mark: Question:
What is the correct way to run a custom YOLOv11n (int8 TFLite) model on Rubik Pi 3 using live camera input and have detection results displayed on screen?

Any guidance on compatible module, constants, or supported formats for qtimlvdetection would be greatly appreciated. Thanks!

Dear customer,
We are currently syncing this issue internally.

module=yolov5

이부분도 바꾸는게 좋을 듯 합니다.
그리고, 데모코드와 작성하신 파이프라인이 좀 다른것 같아요

waylandsink가 지금 qtimlvdetection브랜치에서 실행되는 건가요??

피드백 감사드립니다. 기존에는 OpenCV를 사용할때보다 많이 어렵네요. 데모코드를 여러번 참고하고 시도해보다가 카메라 스트리밍 + yolov11 커스텀 모델 구동이 이루어지지않아서 파이프라인이 많이 바뀐거같아요. 제가 사용하는 모델은 Qualcomm AI Hub에서 양자화한 YOLOv11n TFLite 포맷인데, qtimlvdetection에서 yolov11이라는 모듈이 따로 없는 상황인 것 같아 어떻게 적절한 module/constant 설정을 해야 하는지 고민 중입니다. 그리고 waylandsink가 qtimlvdetection브랜치에서 실행중인게 맞습니다.

현재 우리 프로젝트는 실시간성이 크게 요구되는 상황이 아니라서, 일단은 파이썬 프로그램에서 GStreamer로 1초 간격으로 이미지를 저장하고, 해당 이미지를 YOLO 모델로 불러와 추론하는 방식으로 우회하여 테스트 중입니다.

혹시 카메라 스트리밍과 YOLO 기반 객체 탐지를 어떻게 구성하셨을까요?

Dear customer
Method One: You can use GStreamer with the qmmf plugin to communicate with the camera service and obtain camera data within Qt or other UI frameworks. Then, directly invoke the TFLite interface to pass image data to the DSP for inference, and render the inference results using Qt. (Wayland and qtimlvdetection are not required.)
Method Two: Utilize Qt or other UI frameworks to call the camx interface to acquire camera data, then directly invoke the TFLite interface to pass image data to the DSP for inference, and render the inference results using Qt. (Wayland and qtimlvdetection are not required.)

waylandsink을 detection브랜치에서 실행하면 안될텐데요…
overlay와 mux플러그인으로 감지결과를 덧씌우는게 맞는 방법일겁니다.
그리고 기업연계캡스톤 중이신거같은데
굳이 yolo11을 사용해야하는 상황이아니면
그냥 데모코드에있는 모델을 사용하는게 마음이 편할거에요

yolo5 나 yolo8로 가는게 맞겠네요
답변주셔서 감사합니다

Thanks for the reply. I’ll give it a try.

Dear customer,
Thank you for your reply. We are looking forward to your good news.

안녕하세요. 최근 QIM SDK로 기본 Dataset기반 train된 Quantized yolov8으로 화면 디스플레이 + 메타데이터 출력까지 성공은 했습니다. 다만, 직접 커스텀한 모델을 Qualcomm Ai Hub를 통해 Quantized를 거쳐 tflite로 export해서 inference까지 잘되는 모델임을 확인했으나 결국 QIM을 통해 카메라 스트리밍 + 커스텀 모델 구동에있어 QIM의 규격과 Qualcomm ai hub에서 Quantized된 모델간의 호환성이 의심되어 결국 놓아주고 기본 모델로 구동하기로 했습니다. 혹시 외부 export 모델을 QIM에서 수행하시며 같은 경험을 하신부분이 있으실까요?

그리고 현재 분기를 2개로하여 화면 디스플레이 + 메타데이터 출력을 진행중인데 화면 디스플레이를 포기하면 장시간 안정적인 추론 + 메타데이터 출력이 가능하나 화면 디스플레이까지 수행하려하니 해상도 및 규격 문제인지 프레임 드랍 및 동적인 스트림이 지속되면 카메라 스트리밍이 멈추는 현상도 발생하는데, 현재 mlnu님께서 진행중이신 프로젝트에서도 화면 디스플레이 + 메타데이터 출력 동시에 진행중이신지 여쭈어봅니다. 감사합니다.

기본 프레임이 30일텐데, 줄여보세요.
저희는 쿨러를 안달았지만,
쿨러를 다는것도 좋은 방법일 것 같습니다.

1 Like

Please do use a cooler, or at least heatsink, if you’re running AI / IMSDK. Otherwise the board might got burnt easily.

1 Like

Thank you. I’ll try to use a cooler

프레임 줄여보는것도 방법이겠네요. 답변주셔서 감사합니다