bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.6k stars 1.59k forks source link

JavaCV with YOLOv7 #1991

Open meeeee12 opened 1 year ago

meeeee12 commented 1 year ago

Is it possible to get YOLOv7 to work with JavaCV? I tried adapting YOLONet.java, using yolov7.weights as my weights file but I dont know what to use for the config file.

meeeee12 commented 1 year ago

As suggested on the YOLOv7 github page I am converting the .pt file to .onnx and testing my onnx file with OpenCV using https://raw.githubusercontent.com/VITA-Alchemy/yolov5_6.0_opencvdnn_python/main/main_dnn.py and it works. I then altered the YOLONET.java and changed readNetFromDarknet to readNetFromONNX referencing the onnx file I genarated and it runs without errors but reports no detections. I am currently stuck and any help would be appreciated.