[Deep Vision Library] How can I use my own YOLO-v5?

[Deep Vision Library] How can I use my own YOLO-v5?


hello. Nice to meet you.

yolo = new YOLONetwork(model, weights, 256, 256);

  1. In case of ‘yolo-v4’
  • Match the ‘cfg file’ to the ‘model’ location.
  • Match the ‘weights file’ to the ‘weights’ location.
  • It works well.
  1. In case of ‘yolo-v5’
  • Which file should be matched to the ‘model’ location?
  • Can I match only one of ‘yolov5l.yaml’ or ‘yolov5m.yaml’ or ‘yolov5s.yaml’ in the ‘weights’ position?

I’m asking because I don’t know how to use it.

For YoloV5 the ONNX models are used. As you can see DeepVision.java, the model is set to null and the weights are for example yolov5s.onnx.

YOLONetwork network = new YOLONetwork(
        640, 640,

1 Like


Thank you.!!!


Thank you for quick response. I have more questions, so I’m leaving an answer.

  1. Is only the extension ‘.onnx’ possible?

  2. If you add the ‘.onnx’ file in the url,

  1. The program runs without error, but
  2. Cannot detect smoke or fire.
    YoloFireAndSmoke/demo/ONNXRuntime at main · Pratham-taneja/YoloFireAndSmoke · GitHub

Is there a reason?

I guess it‘s because you are trying to run a YoloX model with the Yolov5 implementation. I don‘t think it will work just out of the box, since pre- and postprocessing are different.