Skip to content
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

Does your code contain the mask mAP computation? #139

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

wuleibupt
Copy link

No description provided.

souryuu added 28 commits July 4, 2017 18:27
- bad assignment in mask.py
- smoothen the cropped features from pyramid in crop.py
- other visualization and minor parameter tuning

fixed network setting
- add relu and maxpooling pad to non-batch normalization scope
- remove batch normalization in the layers before loss

Fixed some mask issues
- temporary fixed inaccurate gt_mask from cv crop and resize
- change gt_mask from int to float
- smoothen mask by cv INTER_CUBIC

Misc.
- match all rois and their target (manually checked through indexs)
corrected mask losses in pyramid_network.py
changed some variable names
added color codes
fixed the issue that is_training=False causes no bounding boxes during test
fixed batch normalization gradient update
change anchor back to 3x3 (5x3 creates too many anchors. anchor_encoder slows down the training significantly)
added recall and precision calculation
set test dataset to val2014
remove random picking data during test
fixed some evaluation problems
changed the layers for pyramid features C2-4 to match the original paper (endpoints of each resnet block)
test.py generates results.json file
pycocoEval.py evaluates AP and AR from results.json

***my max current AP 0.5 is 0.262
@souryuu
Copy link
Contributor

souryuu commented Aug 31, 2017

The one in fix_testing branch is included with evaluation API from coco.
However, I have change many things on the branch. I think you can not directly use it to evaluate your trained network. You may need to retrain the network.

… yet)

current mAP@50 IOU by FPN+Resnet50 (training from scratch) is 43.7%
changed anchor scale to match with the original paper
changed head parts of RPN RCNN and Mask
rename and remove multiple variables
changed some hyper params to reduce overfitting (mAP@1M train:0.47 test:0.36)
removed images with extreme aspect ratio which cause OOM from tfrecords (records must be re-created)
@souryuu
Copy link
Contributor

souryuu commented Sep 29, 2017

With current version, I added the evaluation part using API from MSCOCO for both bounding box and mask. You can evaluate the network by

python train/test.py
python pycocoEval.py

After training up to 1M+ iteration, I got mAP(mask IoU=0.5) on training data = 0.47 and on testing data = 0.36 (comparing to original paper Resnet 50 mAP of 0.512). Please note that your previously trained networks and created tfrecords may not work with this version because I changed a lot of network settings.

I found 2 problems but I will not have time to fix it.
1). I tried to set is_training in Resnet and header to False during training but the performance dropped to ~0.20. If is_training is set to true, I got the above performance . I think this has something to do with batch normalization layers. Probably batch_size =1 is the problem. However, it seems that tensorflow does not support for batching images with dynamic shape.
2). When training with too high/low aspect ratio images, the convolutional features in pyramid become too large and GPU goes OOM. In order to train the current version, I removed too high/low aspect ratio images from the tfrecords.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants