Darknet YOLO image size

Farahats9 picture Farahats9 · Mar 23, 2018 · Viewed 31.8k times · Source

I am trying to train custom object classifier in Darknet YOLO v2 https://pjreddie.com/darknet/yolo/

I gathered a dataset for images most of them are 6000 x 4000 px and some lower resolutions as well.

Do I need to resize the images before training to be squared ?

I found that the config uses:

[net]
batch=64
subdivisions=8
height=416
width=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

thats why I was wondering how to use it for different sizes of data sets.

Answer

Nerxis picture Nerxis · Apr 23, 2018

You don't have to resize it, because Darknet will do it instead of you!

It means you really don't need to do that and you can use different image sizes during your training. What you posted above is just network configuration. There should be full network definition as well. And the height and the width tell you what's the network resolution. And it also keeps aspect ratio, check e.g this.