allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.71k stars 877 forks source link

Keras predictions not matching Darknet's #117

Open symepge opened 6 years ago

symepge commented 6 years ago

I am converting a tiny YOLO-v2 model from Darknet to Keras using the yad2k. However, the predictions from the converted model are significantly worse than those of Darknet. So, I was wondering:

MassyMeniche commented 6 years ago

@symepge run to the same problem :( did you solve this problem ?

symepge commented 6 years ago

Yes, I did! The problem for me was the following: YOLO in Darknet resizes images to the desired input size (e.g. 416x416) by zero-padding and scaling, hence, keeping the original aspect ratio. The Keras implementation, however, scales the images without zero-padding and hence, changes the aspect ratio of the images. That throws off the model and negatively impacts the quality of the predictions. You can resolve the issue by proper scaling of the images. I hope it helps!