tensorflow-yolov4-tflite icon indicating copy to clipboard operation
tensorflow-yolov4-tflite copied to clipboard

Why do you get only 61.96% AP50 for YOLOv4-512x512 instead of 64.9% AP50 that I can get by using Darknet?

Open AlexeyAB opened this issue 3 years ago • 11 comments

@hunglc007 Hi,

Why do you get only 61.96% AP50 for YOLOv4-512x512 https://github.com/hunglc007/tensorflow-yolov4-tflite#map50-on-coco-2017-dataset instead of 64.9% AP50 that I can get by using Darknet? https://github.com/AlexeyAB/darknet/wiki/How-to-evaluate-accuracy-and-speed-of-YOLOv4

Did you use https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights for evaluation or train your own model for this case?

AlexeyAB avatar Jul 23 '20 22:07 AlexeyAB

There seems to be inconsistency in detection using the Darknet and Tensorflow. TF detects fewer objects and with less confidence.

It seems to find the reason you need a layer-by-layer comparison of the feature map TF vs Darknet.

Model Darknet hunglc007/tensorflow-yolov4-tflite (pb, tflite, tfile16)
YOLOv4 yolo_v4 tf_v4_pb
YOLOv4-tiny yolo_v4_tiny tf_v4_tiny_pb

Original image: test

AlexeyAB avatar Jul 26 '20 13:07 AlexeyAB

There seems to be inconsistency in detection using the Darknet and Tensorflow. TF detects fewer objects and with less confidence.

It seems to find the reason you need a layer-by-layer comparison of the feature map TF vs Darknet.

Model Darknet hunglc007/tensorflow-yolov4-tflite (pb, tflite, tfile16) YOLOv4 yolo_v4 tf_v4_pb YOLOv4-tiny yolo_v4_tiny tf_v4_tiny_pb Original image: test

Would you recommend and better TensorFlow implementation. my better i mean better detection and faster processing.

robisen1 avatar Jul 29 '20 05:07 robisen1

result (1)

I am training yolov4-tiny with activation set to relu. The inference result using weights(mAP50-29%) is as above. I don't know if this will help.

hhk7734 avatar Aug 19 '20 03:08 hhk7734

yolov4-tiny

Using yolov4-tiny.weights, I trained 300 times with batch_size=32. The result is as above.

hhk7734 avatar Aug 19 '20 05:08 hhk7734

result (1)

I am training yolov4-tiny with activation set to relu. The inference result using weights(mAP50-29%) is as above. I don't know if this will help.

Have you made any other changes besides relu? I would be interested in looking at the code if your able/willing to share.

robisen1 avatar Sep 04 '20 05:09 robisen1

Ref

  • https://wiki.loliot.net/docs/etc/project/yolov4/yolov4-training
  • https://github.com/hhk7734/tensorflow-yolov4
from yolov4.tf import YOLOv4

yolo = YOLOv4()

yolo.classes = "coco.names"

yolo.make_model(activation1="relu")
yolo.load_weights("yolov4-tiny-relu.weights", weights_type="yolo")

yolo.inference(media_path="kite.jpg")

yolo.inference(media_path="road.mp4", is_image=False)

hhk7734 avatar Sep 04 '20 11:09 hhk7734

Thank you.

robisen1 avatar Sep 07 '20 07:09 robisen1

@AlexeyAB @hunglc007 Do you have anything new about the conversion between darknet and tensorflow? I have inconsistent results when converting from yolov3 darknet to tensorflow with this repo too. Currently, there aren't any repos that can convert the exact result from darknet to tensorflow as my research.

vqbang avatar Sep 11 '20 11:09 vqbang

@AlexeyAB @hunglc007 Do you have anything new about the conversion between darknet and tensorflow? I have inconsistent results when converting from yolov3 darknet to tensorflow with this repo too. Currently, there aren't any repos that can convert the exact result from darknet to tensorflow as my research.

@vqbang did you get any solution?

Fetulhak avatar Jul 16 '21 12:07 Fetulhak

@AlexeyAB @hunglc007 Do you have anything new about the conversion between darknet and tensorflow? I have inconsistent results when converting from yolov3 darknet to tensorflow with this repo too. Currently, there aren't any repos that can convert the exact result from darknet to tensorflow as my research.

@vqbang did you get any solution?

Yes I would also like to hear what you get too!

zz100chan avatar Dec 16 '21 09:12 zz100chan

@zz100chan unfortunately I did not get the solution. Maybe there are other heuristics in the Darknet version which may be the reason for its good detection performance. The tenserflow version of YOLO detectors miss a lot of detections. I don't know why? Even I tried the OpenCV Yolo DNN but still not as good as Darknet.

Fetulhak avatar Dec 16 '21 11:12 Fetulhak