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 787 forks source link

Using Class weights while training on Imbalanced training data #405

Open Prak11 opened 5 years ago

Prak11 commented 5 years ago

I have imbalanced annotations for my dataset. I want to introduce class weights in the fit_generator for every batch that I get after the train_generator is defined in train.py file. How do I get the information on classes/labels in every batch and the count which I can give class_weights to the fit_generator ?