-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement] Training custom classes of ava dataset #555
[Improvement] Training custom classes of ava dataset #555
Conversation
Codecov Report
@@ Coverage Diff @@
## master #555 +/- ##
==========================================
+ Coverage 84.17% 84.47% +0.29%
==========================================
Files 121 124 +3
Lines 8613 8797 +184
Branches 1427 1478 +51
==========================================
+ Hits 7250 7431 +181
- Misses 1014 1015 +1
- Partials 349 351 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
configs/detection/ava/slowonly_kinetics_pretrained_r50_4x16x1_20e_ava_rgb_custom_classes.py
Outdated
Show resolved
Hide resolved
Some minor comments |
Maybe this pr is not that useful as I expected... Training custom classes leads to lower mAP... Most classes with hight AP(>0.3) get worse results.
I'll do more tests
@innerlee @kennymckormick any suggestions? |
Maybe you can try to pick the best model among epoch 11 -> 20, and see if its performance is better. |
Actually, I choose the best ckpt(epoch no.14), not the last one.. |
Finally get some good results...
|
Good results! You can choose a successful example to add configs and checkpoints. Also remember to add ur results to README file. |
ckpt/json/log are uploaded here |
kindly ping @kennymckormick |
Got it |
Add ckpt trained by custom classes in model zoo along with other models may be a little bit misleading. How about create a table for custom classes only... |
Sorry seems I have no permission to download the files. Would you please upload the ckpts with other tools? (like dropbox, googledrive, baiduyun or transfer.sh) |
I'll upload these to baiduyun tonight... Cannot use other tools while in the company. |
I think we need a pair of checkpoint and config file for users to try this feature. Besides, I think we can create a separate table for custom classes. |
gotcha |
@innerlee ready now |
Would u plz help solve the lint issue @irvingzhang0512 , I did't install markdown lint on the machine I commit |
Sorry I need to get a understanding on the motivation. Does custom==subset here? What if you simply filter the annotation file? Or use some re-sampling strategy to solve the class imbalance problem? |
Here custom==subset. The motivation is: 1. Sometimes you only need to recognize a subset of action classes, and training on the subset led to better performance. 2. Adding a line in the config file is better than regenerating annotation files when doing filtering. |
So an alternative implementation would be, writing a scirpt to fitler a subset of the annotation file, right? An even better alternative is, implementing a sampling strategy on a class-basis, so that you can adjust the sampling ratio of any class to any propotions, including exclusion by setting |
The first alternative is OK, but sometimes you don't want to have additional files generated. |
There is a little difference between the first alternative and this pr. This pr modifies label id and num_classes. I was planning to train ava (or my own dataset) with softmax loss (single label instead of multi label) someday. |
I will post a discussion later today :) |
kindly ping @innerlee |
I'm still trying to understand the motivation, so please be patient.
|
Yes
Yes
We should remove records that do not belong to custom classes AND change the label id of the samples that belong to custom classes. Sorry about my poor english, I may explain in chinese here. 为什么要对custom classes重新编号而不是使用原始编号?
另外也多说几句为什么要这个PR:
|
Thanks for the explanation. Considering that this change is fairly local (only affects ava dataset), and provides some convinent tool for real use cases, plus @kennymckormick , who will maintain this piece of code, has approved, I will merge it. There are some alternative ways, and may leave to future,
|
Target
Training some of the 80 ava classes to save training time and hopefully get better results for selected classes.
TODO
topk
forBBoxHeadAVA
, becausenum_classes
may be smaller than 5.check whetherexclude_file_xxx
will affect the results.results
PERSON_MOVEMENT
classes[11, 12, 14, 15, 79, 80]
[1,4,8,9,13,17,28,49,74]
[3, 6, 10, 27, 29, 38, 41, 48, 51, 53, 54, 59, 61, 64, 70, 72]
[11,12,17,74,79,80]
[1,8,14,59]
[3,4,6,9,10,15,27,28,29,38,41,48,49,54,61,64,65,66,67,70,77]
[22,37,47,51,63,68,72,78]
[2,5,7,13,20,24,26,30,34,36,42,45,46,52,56,57,58,60,62,69,73,75,76]
[16,18,19,21,23,25,31,32,33,35,39,40,43,44,50,53,55,71]
insights
I think ava dataset suffers from series class imbalance. Training custom classes helps to get better results for classes with fewer samples.