Skip to content

fix: transpose scale_factors to match the shape of [batch_size, 4] #8757

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Raysilience
Copy link

Motivation

When using mmdet.apis.inference.inference_detector to infer a batch of images, I ran into the problem at the 258th line of test_mixins.py indicating the shape mismatch between det_bboxes and 'scale_factors. It turns out that a float scale factor will be expanded by 4 at line 241, thus, outputting a vector of shape (4, batch_size). Whereas det_bboxes` has a shape of [batch_size, 5]

Modification

Transpose scale_factors to match the shape of [batch_size, 4]

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Sep 8, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ZwwWayne
Copy link
Collaborator

Hi @Raysilience

Thanks for your kind PR. It seems that CLA is not signed. Could you sign the CLA so that eventually we could merge this PR after review? You can check the contents and follow the instruction in the communication box shown as below
image

@ZwwWayne ZwwWayne added this to the 2.27.0 milestone Sep 14, 2022
@BIGWangYuDong BIGWangYuDong changed the base branch from master to dev September 14, 2022 07:31
@Raysilience
Copy link
Author

Hi @ZwwWayne ,
I've just signed it. Now you should be able to merge.

@codecov
Copy link

codecov bot commented Oct 8, 2022

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f8bbba2) 64.08% compared to head (c183168) 64.00%.
Report is 94 commits behind head on dev.

Files Patch % Lines
mmdet/models/roi_heads/test_mixins.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8757      +/-   ##
==========================================
- Coverage   64.08%   64.00%   -0.09%     
==========================================
  Files         361      361              
  Lines       29525    29525              
  Branches     5020     4918     -102     
==========================================
- Hits        18922    18897      -25     
- Misses       9589     9611      +22     
- Partials     1014     1017       +3     
Flag Coverage Δ
unittests 64.00% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OpenMMLab-Assistant005
Copy link

Hi @Raysilience !We are grateful for your efforts in helping improve this open-source project during your personal time.
Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA
If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution❤

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.

6 participants