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

fix fcos gt_areas calculation #5816

Merged
merged 3 commits into from
Apr 19, 2022
Merged

Conversation

simonJJJ
Copy link
Contributor

I fix the gt_areas calculation in the FCOS model.

@facebook-github-bot
Copy link

Hi @simonJJJ!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@simonJJJ
Copy link
Contributor Author

simonJJJ commented Apr 15, 2022

Hi @datumbox , can you take a look at this?

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonJJJ LGTM, thanks a lot for patching this. This is definitely a typo which remained undetected.

@xiaohu2015 @zhiqwang @jdsgomes I assume this ended up having little effect on the overall accuracy. Do we want to retrain and confirm?

@datumbox datumbox merged commit 6a53c9a into pytorch:main Apr 19, 2022
@github-actions
Copy link

Hey @datumbox!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

@xiaohu2015
Copy link
Contributor

xiaohu2015 commented Apr 19, 2022

@simonJJJ LGTM, thanks a lot for patching this. This is definitely a typo which remained undetected.

@xiaohu2015 @zhiqwang @jdsgomes I assume this ended up having little effect on the overall accuracy. Do we want to retrain and confirm?

yes, I think it maybe has little effect on the overall accuracy, becuase here we don't have many situations which one position match multiple GTs (it rarely happens with the scale range constraint). But I think we should retrain the model if possible.

@xiaohu2015
Copy link
Contributor

I fix the gt_areas calculation in the FCOS model.

Thanks a lot

@jdsgomes
Copy link
Contributor

Thanks for the fix @simonJJJ . I am running the training just to make sure the impact is not significant.

@jdsgomes
Copy link
Contributor

Thanks for the fix @simonJJJ . I am running the training just to make sure the impact is not significant.

I have re-run the training job and the performance difference does not seem significant.

With the fix:

IoU metric: bbox
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.390
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.578
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.418
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.218
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.423
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.513
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.326
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.530
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.565
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.358
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.602
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.731
Training time 5:50:18
submitit INFO (2022-04-21 01:28:12,411) - Job completed successfully

Original results:

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.392
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.582
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.420
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.222
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.423
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.513
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.324
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.529
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.562
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.350
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.609
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.728

So I don't think there is a need to update the pre-trained weights or take any further action.

In any case thank you @simonJJJ again for making the fix!

@datumbox
Copy link
Contributor

Agreed. I don't think it's worth releasing a new pair of weights for 0.2 mAP.

Soon we can try to retraining FCOS after #5410 is completed to really push its accuracy similarly to what we did with FasterRCNN and RetinaNet. This should give us a material push on the accuracy of several mAP points.

facebook-github-bot pushed a commit that referenced this pull request May 5, 2022
Summary: Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>

Reviewed By: jdsgomes, NicolasHug

Differential Revision: D36095652

fbshipit-source-id: 3b9a75c78b859d20b42d6f7c24917f79fd67a56c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants