-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 IOU assigners when ignore_of_thr > 0 and no pred boxes #2135
Fix IOU assigners when ignore_of_thr > 0 and no pred boxes #2135
Conversation
@@ -119,7 +119,7 @@ def assign(self, | |||
bboxes = squares[:, :4] | |||
|
|||
if (self.ignore_iof_thr > 0) and (gt_bboxes_ignore is not None) and ( | |||
gt_bboxes_ignore.numel() > 0): | |||
gt_bboxes_ignore.numel() > 0 and bboxes.numel() > 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Since there are lots of conditions, we can just use one pair of brackets to hold them.
if (self.ignore_iof_thr > 0 and gt_bboxes_ignore is not None
and gt_bboxes_ignore.numel() > 0 and bboxes.numel() > 0):
pass
BTW, it seems that the latest ubelt (0.8.9) is broken. An import error will be raised for |
Yes, ubelt 0.8.9 was broken. I had incorrectly used find_packages in the setup.py file. I just released 0.9.0, which (I believe) fixes the issue. I've also removed the extra parens. |
* jon/dev/fix_fpn2: (33 commits) Fix FPN upscale fix analyze log (open-mmlab#2150) Fix a documentation error in GETTING_STARTED.md (open-mmlab#2149) add optimizer registry (open-mmlab#2139) Update version to 1.1 (open-mmlab#2144) Fix IOU assigners when ignore_of_thr > 0 and no pred boxes (open-mmlab#2135) reset worker_seed (open-mmlab#2111) Fix issue with list of metrics in CustomDataset.evaluate (open-mmlab#2128) Code Release: CARAFE: Content-Aware ReAssembly of FEatures (ICCV 2019) (open-mmlab#1583) fixed test package (open-mmlab#2127) add an argument format-only to handle the json formating (open-mmlab#2114) fix (get_cls_results): use np.empty for empty bbox rather than np.arrary (open-mmlab#2116) fix (dpool): directly return empty if rois's length is 0 (open-mmlab#2099) fix workflow problem (open-mmlab#2103) Uint8 fix (open-mmlab#2105) Fix device bug (open-mmlab#2098) fix test ddp initialize (open-mmlab#2100) set FORCE_CUDA (open-mmlab#2097) Speed up sampler (open-mmlab#2094) Use official DDP to implement MMDDP (open-mmlab#2090) ...
…b#2135) * Fix IOU assigners when ignore_of_thr > 0 and no pred boxes * remove extra brakets * fix test linter
* tag 'v1.1.0': (29 commits) Update version to 1.1 (open-mmlab#2144) Fix IOU assigners when ignore_of_thr > 0 and no pred boxes (open-mmlab#2135) reset worker_seed (open-mmlab#2111) Fix issue with list of metrics in CustomDataset.evaluate (open-mmlab#2128) Code Release: CARAFE: Content-Aware ReAssembly of FEatures (ICCV 2019) (open-mmlab#1583) fixed test package (open-mmlab#2127) add an argument format-only to handle the json formating (open-mmlab#2114) fix (get_cls_results): use np.empty for empty bbox rather than np.arrary (open-mmlab#2116) fix (dpool): directly return empty if rois's length is 0 (open-mmlab#2099) fix workflow problem (open-mmlab#2103) Uint8 fix (open-mmlab#2105) Fix device bug (open-mmlab#2098) fix test ddp initialize (open-mmlab#2100) set FORCE_CUDA (open-mmlab#2097) Speed up sampler (open-mmlab#2094) Use official DDP to implement MMDDP (open-mmlab#2090) log meta (open-mmlab#2086) fix pad_val not used in class Pad when pad to a fixed size (open-mmlab#2093) remove cython docs (open-mmlab#2091) remove new_tensor (open-mmlab#2092) ...
…b#2135) * Fix IOU assigners when ignore_of_thr > 0 and no pred boxes * remove extra brakets * fix test linter
…b#2135) * Fix IOU assigners when ignore_of_thr > 0 and no pred boxes * remove extra brakets * fix test linter
* fix load_weight and no bbox output
* improve ckpt averaging * fix * fix
When ignore_of_thr is enabled and there are no predicted bboxes, the
.max
function fails because theignore_overlaps
tensor is empty. The error is as follows:This can be fixed by simply checking that bboxes isn't empty before running the code. I've added this fix for both approx and max iou assigners. I've also added a test, which currently passes, but will fail if the patch is removed.