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

Model detects one class at a time #4576

Open Rookie-81 opened 4 years ago

Rookie-81 commented 4 years ago

Hello I’ve trained yolo to detect 4 geometric shapes and i used kaggle 4 shapes dataset, i used 50 images of each class (200 in total) and i annotated them using yolo mark, my model gets nice predictions only if i show it something that is similar to training set(overfitting?) and if i put 3 shapes in one picture and run a test nothing is predicted. Thanks in advance.

Sent with GitHawk

AlexeyAB commented 4 years ago

Show examples.

Add mosaic=1 to the [net] in cfg-file and train again.

HagegeR commented 4 years ago

maybe you need to train with photos containing multiple shapes in order to detect them

Rookie-81 commented 4 years ago

Screenshot from 2019-12-24 00-02-09 Screenshot from 2019-12-24 15-16-11 Thank You for replying @AlexeyAB here are the examples one is successful and the other is not. the successful detection looks exactly like the data set i used to train, i need my model to work in an ROV in detecting those shapes underwater, so any ideas about the dataset or augmentation are highly appreciated as well Thanks in advance!

Rookie-81 commented 4 years ago

@HagegeR
will do in the next training session, but does training image size affect detection later? thank you!

HagegeR commented 4 years ago

but does training image size affect detection later?

yes it affects AP.

i need my model to work in an ROV in detecting those shapes underwater

I'm not sure that using training dataset so far from the final test could help. also, try to move the shape in the image, rotate them, change the background color, change the level of blackness, add noise... anything that could make the dataset closer to the actual task will help

AlexeyAB commented 4 years ago

https://github.com/AlexeyAB/darknet#how-to-improve-object-detection

for each object which you want to detect - there must be at least 1 similar object in the Training dataset with about the same: shape, side of object, relative size, angle of rotation, tilt, illumination. So desirable that your training dataset include images with objects at diffrent: scales, rotations, lightings, from different sides, on different backgrounds - you should preferably have 2000 different images for each class or more, and you should train 2000*classes iterations or more