AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.96k forks source link

How to set width and height in cfg,my pic's resolution of 2500*2000 #1738

Open shkai opened 5 years ago

shkai commented 5 years ago

I set cfg width = 800,height = 800,i find some objects undetectable. when i set width = 608,height = 608, the detetor imporved.So,the higher the resolution will be better?

AlexeyAB commented 5 years ago

If you Train and Test your model with higher resolution - then in the most cases accuracy will be better.

If you Train on low resolution and Test on slightly higher resolution - then in several cases accuracy will be better.

If you Train on low (416x416) resolution and Test on signitificantly (>=2x) higher (832x832) resolution - then in few cases accuracy will be better.


Because you should follow the rule: https://github.com/AlexeyAB/darknet#how-to-improve-object-detection

General rule - your training dataset should include such a set of relative sizes of objects that you want to detect:

train_network_width * train_obj_width / train_image_width ~= detection_network_width * detection_obj_width / detection_image_width