Skip to content

Conversation

@tyomj
Copy link
Contributor

@tyomj tyomj commented Jan 23, 2020

This PR adds two more options for test config (see the example bellow).

test_cfg = dict(
    rpn=dict(
...
    ),
    rcnn=dict(
        score_thr=0.05,
        nms=dict(type="nms", iou_thr=0.5),
        max_per_img=100,
        mask_thr_binary=0.5,
        rle_mask_encode=False, # (1)
        crop_mask=True, # (2)
    ),
)
  1. Allows one to disable costly RLE when you need raw binary masks for some postprocessing tricks
  2. Since rle_mask_encode = False you'll recieve N(=number of boxes) binary masks in fullres. In order to decrease memory usage option crop_mask=True allows you to get mask with the position inside an appropriate bbox.

Both are optional and disabled by default.


Updated and might be referenced as an example of usage.

@tyomj tyomj requested a review from hellock January 23, 2020 18:29
np.array(im_mask[:, :, np.newaxis], order='F'))[0]
cls_segms[label - 1].append(rle)

if rcnn_test_cfg.get("box_rel_masks"):
Copy link
Member

Choose a reason for hiding this comment

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

  1. Single quote is preferred.
  2. It is better to set the default value to bool type instead of None.
  3. The two field may be renamed to crop_mask (False) and rle_mask_encode (True)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Done
  2. Done
  3. Yes!)

Copy link
Member

Choose a reason for hiding this comment

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

Nice work!

@hellock hellock merged commit 51bf54a into open-mmlab:master Jan 28, 2020
mattdawkins added a commit to VIAME/mmdetection that referenced this pull request Mar 13, 2020
* origin/viame/master: (28 commits)
  Fix FPN upscale
  Extra compiler args
  VIAME-specific build parameters
  Bump version to 1.0.0 (open-mmlab#2029)
  Fix the incompatibility of the latest numpy and pycocotools (open-mmlab#2024)
  format configs with yapf (open-mmlab#2023)
  options for FCNMaskHead during testtime (open-mmlab#2013)
  Enhance AssignResult and SamplingResult (open-mmlab#1995)
  Fix typo activatation -> activation (open-mmlab#2007)
  Reorganize requirements, make albumentations optional (open-mmlab#1969)
  Encapsulate DCN into a ConvModule & Conv_layers (open-mmlab#1894)
  Code for Paper "Bridging the Gap Between Anchor-based and Anchor-free… (open-mmlab#1872)
  Non color images (open-mmlab#1976)
  Fix albu mask format bug (open-mmlab#1818)
  Fix CI by limiting the version of torchvision (open-mmlab#2005)
  Add ability to overwite existing module in Registry (open-mmlab#1982)
  bug for distributed training (open-mmlab#1985)
  Update Libra RetinaNet config with the latest code (open-mmlab#1975)
  Fix issue in refine_bboxes and add doctest (open-mmlab#1962)
  add link to official repo (open-mmlab#1971)
  ...
ioir123ju pushed a commit to ioir123ju/mmdetection that referenced this pull request Mar 30, 2020
* options for mask during testtime

* handle comments
mike112223 pushed a commit to mike112223/mmdetection that referenced this pull request Aug 25, 2020
* options for mask during testtime

* handle comments
FANGAreNotGnu pushed a commit to FANGAreNotGnu/mmdetection that referenced this pull request Oct 23, 2023
jben-hun pushed a commit to jben-hun/mmdetection that referenced this pull request Jan 10, 2025
* options for mask during testtime

* handle comments
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.

2 participants