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

refactor GFL head #154

Merged
merged 19 commits into from
Feb 20, 2021
Merged

refactor GFL head #154

merged 19 commits into from
Feb 20, 2021

Conversation

RangiLyu
Copy link
Owner

Refactor GFL head

  1. Using center points to generate grid cells instead of using anchor generator.
  2. Directly parse the target assign results with a sample function instead of using Sampler class.
  3. Rename some parameters and add more comments for easier understanding.

Notice: The center point generated by the refactored code has an offset of 0.5 in the input coordinates from the original GFLHead implemented in MMDetection.

For example: On the feature map which stride=8, the center point coordinate of the first pixel(grid cell) is (4, 4) in the refactored code. But in the MMDetection implemention, the first center point is (3.5, 3.5). In my opinion, (4, 4) should be the correct coordinate.

This may leads to a slightly mAP drop. On nanodet-m the drop is 0.0017. Just several steps of fine-tuning will fix this.

@RangiLyu RangiLyu merged commit b1c063a into main Feb 20, 2021
@RangiLyu RangiLyu deleted the refactor branch February 20, 2021 14:58
@RangiLyu
Copy link
Owner Author

This problem is caused by the different selection of the origin of the coordinate system. Whether to choose the top left corner as the origin of the coordinate system or the center point of the first pixel. I choose to select the top left corner as the origin point, cause after mapping the pixel center point of the input size back to the original image size, the origin is 0.5 times the distance of the downsampling ratio from the real image edge.

@RangiLyu RangiLyu mentioned this pull request Mar 1, 2021
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.

1 participant