Skip To Main Content
Support Knowledge Base

Unable to Run Inference with Converted YOLOv5s Intermediate Representation (IR) Model

Content Type: Troubleshooting   |   Article ID: 000093870   |   Last Reviewed: 11/13/2023

Description

Unable to determine how to run YOLOv5s and YOLOv7-tiny model on Raspberry* Pi 4B with Intel® NCS2.

Resolution

  1. Clone YOLOv5 GitHub* repository:
    git clone https://github.com/ultralytics/yolov5
  2. Install pre-requisites:
    cd yolov5
    pip install -r requirements.txt
  3. Download YOLOv5s PyTorch model from Pretrained Checkpoints.
  4. Convert YOLOv5s PyTorch model into ONNX* format:
    python export.py --weights yolov5s.pt --img 640 --batch 1 --include onnx​
  5. Convert the YOLOv5s ONNX* model from the official into Intermediate Representation (IR) format using openvino-dev[onnx] pip package with the following command:
    mo --input_model yolov5s.onnx --output <output_nodes> --data_type FP16 --scale_values=images[255] --input_shape=[1,3,640,640] --input=images
  6. Run the Object Detection Python Demo using YOLOv5s IR model with the following command:
    python3 object_detection_demo.py -at yolov4 -d MYRIAD -m yolov5s.xml -i <path_to_input>

Related Products

This article applies to 1 products.