experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 784 forks source link

Train new pretrained model #278

Open StefanCola opened 6 years ago

StefanCola commented 6 years ago

Hello,

All the pretrained models didn't result in good accuracy.

So I decided to train my own pretrained model.

I have very small grasses to detect, in an image of 1920x1080 they aren't bigger than 100x100 pixels. So I trained Full Yolo on a 100x100 dataset, my accuracy is roundabout 90%.

When I use these model weights as Backend_pretrained model and start training yolo on HD images, the accuracy starts at 0.15 and degrees down to zero. I have no Recalls.

I can't find my mistake. Isn't yolo able to detect object with large x and very small y dimension? Do I have to note something by training the pretrained model?

rodrigo2019 commented 6 years ago

I got a similar problem, my dataset has resolution 640x480 and my objects has around 80x30, to increase my performance I removed a convolution block from TinyDarknet, so the grid got a size of 16x16 instead 8x8

ZacharyForrest commented 6 years ago

Presumably you'll need to adjust your anchors when training on the HD images - are you doing that?

StefanCola commented 6 years ago

I am generating the anchors as shown in the readme file with gen_anchors. I am also confused because the anchor ratios are near to zero

shivaram93 commented 6 years ago

how do we generate own anchors for our custom dataset with the help of gen_anchors.py?

mdawas commented 6 years ago

@shivaram93 you just need to run the script and pass the config file as an argument. Make sure to adjust the config file to match your needs.