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

Pretrained weights for yolov3-tiny for custom object detection #2437

Open Rahul-Venugopal opened 5 years ago

Rahul-Venugopal commented 5 years ago

Hi ,

It is written that to get pretrained weights I have to use yolov3-tiny.conv.15 for yolov3_tiny. In yolov2 it was for 13 layers and when I check the yolov3_tiny configuration , it consists of 13 conv layers and two yolo layers . Are we supposed to use yolov3-tiny.conv.15 or yolov3-tiny.conv.13 ? If I am using 15 , isn't using all the layers instead of using only convolutional layers ?

It would be great if someone can help me to understand the logic behind this.

Thanks Rahul

AlexeyAB commented 5 years ago

@Rahul-Venugopal Hi,

You should use yolov3-tiny.conv.15 as described.

15 - is a number of layers (even non-conv-layers) which will be extracted from yolov3-tiny.weights that is trained for MS COCO dataset. The first 15 layers [0-14] don't depend on specific class, while layer-15 is suitable only for 80 classes from COCO dataset. Just layers without weights will not be saved.

Rahul-Venugopal commented 5 years ago

@AlexeyAB

Thanks for clearing the doubt.

I have seen your instructions to improve detection on big and small objects and it says

for training for both small and large objects use modified models:

- Full-model: 5 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3_5l.cfg

- Tiny-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-tiny_3l.cfg

- Spatial-full-model: 3 yolo layers: https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov3-spp.cfg

Is there any link to download weights for this models ? Could you also please tell me how many layers I have to use in partial command to obtain pretrained weights for training on a custom dataset with these models ?

Thanks Rahul

AlexeyAB commented 5 years ago

@Rahul-Venugopal

15 for tiny 81 for full and full-spp

darknet.exe partial cfg/yolov3.cfg yolov3.weights yolov3.conv.81 81
darknet.exe partial cfg/yolov3-tiny.cfg yolov3-tiny.weights yolov3-tiny.conv.15 15

There is only weights for Full-spp: https://pjreddie.com/media/files/yolov3-spp.weights

https://github.com/AlexeyAB/darknet#pre-trained-models