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

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

@cansik

hello. Nice to meet you.

yolo = new YOLONetwork(model, weights, 256, 256);
yolo.setLabels(LABEL);
yolo.setup();

  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.
help.

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(
        null,
        "my-model.onnx",
        640, 640,
        true
);

network.loadLabels(names.getPath());
network.setTopK(100);
1 Like

@cansik

Thank you.!!!

@cansik

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.