How to convert yolov4 models into tensorflow and use it in OpenCV

Hi there,
I’m trying to convert a yolo training into tensorflow model to use it with OpenCV Python. I am using this library GitHub - hunglc007/tensorflow-yolov4-tflite: YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite.

I can convert yolo weights into tensorflow .pb file but is there a way to get a pbtxt file from this conversion or not ? Because the function “readNetFromTensorflow” of OpenCV need a .pb and a .pbtxt file to work…

Or is there another way to not use a pbtxt in OpenCV but only a .pb file ?

Thanks,
Thomas.

Hi .
Why don’t you use the OpenCv darknet module ? I mean dnn::readFromDarknet.
It is a very good module to load and use the darknet models like yolov3 and yolov4 and etc.
OpenCv has got some problems to load Tensorflow models in some operations.

Hi,
I used Darknet and yolov4 but for our product, we want to test with Tensorflow. My first idea was to convert my existing yolvo4 to a tensorflow model but I think that is tricky so I went on another way.

Thanks for your response anyway.