YAD2K
YAD2K copied to clipboard
Keras predictions not matching Darknet's
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:
- Is this an exact copy of Darknet implementation or we should expect differences?
- In any case, do you have any ideas about how to improve my Keras predictions? Or where I may have gone wrong?
@symepge run to the same problem :( did you solve this problem ?
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!