Closed MiXaiLL76 closed 2 years ago
The code is presented in ZIP. there is an ipynb file to repeat the error. I also provide a pdf conversion of this file for a better preview. bug_report.pdf
Hi, @MiXaiLL76 , I have read your bug_report and verified it's a bug, thanks. And could you please propose a pr to fix it?
@chhluo I haven’t made a pull request in global frameworks for a long time) Of course I will
I think keep = keep.nonzero()[0]
is better than keep = np.where(keep == True)[0]
, because the meaning of the former is more
straightforward.
@chhluo I created a pull request with the changes you suggested (tested them, they work). Also corrected a typo in the output of the function description.
Should I close this issue?
No, this issue will be closed automatically when the pr is merged.
Checklist
Describe
When working with datasets in PolygonMasks mode, indexes are transferred incorrectly.
Reproduction
Dataset loader pipeline and use poly2mask=False
Did you make any modifications on the code or config? Did you understand what you have modified?
What dataset did you use?
Environment
python mmdet/utils/collect_env.py
to collect necessary environment information and paste it here.I add dataset and bug example file
Error traceback
bug have not traceback
Why did the bug happen?
The PolygonMasks module does not support numpy binary arrays for selection.
Bug fix
I have already fixed this bug by adding a boolean mask conversion to indexes in the function.
You need to add the following code to line 627 in the file: https://github.com/open-mmlab/mmdetection/blob/ca11860f4f3c3ca2ce8340e2686eeaec05b29111/mmdet/datasets/pipelines/loading.py#L627
CODE:
PS...
There is still a small typo in the output of information about the function in line 410 of the file =)
https://github.com/open-mmlab/mmdetection/blob/ca11860f4f3c3ca2ce8340e2686eeaec05b29111/mmdet/datasets/pipelines/loading.py#L410
CODE to fix: