Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Darknet YOLO image size

Tags:

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.

like image 441
Farahats9 Avatar asked Mar 23 '18 13:03

Farahats9


People also ask

What is image size in Yolo?

Input Size. The standard input resolution for YOLOv3 is 416 × 416 pixels. Since the original images usually have higher resolution, they need to be down-sampled to an input size of 416 × 416 prior to the input into the network.

How does Yolo resize?

The major concept of YOLO is to build a CNN network to predict a (7, 7, 30) tensor. It uses a CNN network to reduce the spatial dimension to 7×7 with 1024 output channels at each location.

How many images are needed for Yolo?

It depends. There is an objective minimum of one image per class. That may work with some accuracy, in principle, if using data-augmentation strategies and fine-tuning a pretrained YOLO network. The objective reality, however, is that you may need as many as 1000 images per class, depending on your problem.


1 Answers

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.

like image 187
Nerxis Avatar answered Oct 24 '22 15:10

Nerxis