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

Update has_mask method for mmdet models #1054

Merged
merged 11 commits into from
Jun 7, 2024
Merged

Update has_mask method for mmdet models #1054

merged 11 commits into from
Jun 7, 2024

Conversation

Alias-z
Copy link
Contributor

@Alias-z Alias-z commented Jun 4, 2024

Solve the issue mentioned in #1053, which leads to empty instance segmentation results with mmdet models

@Alias-z
Copy link
Contributor Author

Alias-z commented Jun 4, 2024

Ummm, probably the CI test ran on an old style of mmdet config, leading to an error. I will try to make that compatible

@Alias-z
Copy link
Contributor Author

Alias-z commented Jun 4, 2024

@fcakyon

class MmdetTestConstants:
    MMDET_CASCADEMASKRCNN_MODEL_URL = "http://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco/cascade_mask_rcnn_r50_fpn_1x_coco_20200203-9d4dcb24.pth"
    MMDET_CASCADEMASKRCNN_MODEL_PATH = (
        "tests/data/models/mmdet/cascade_mask_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco_20200203-9d4dcb24.pth"
    )
    MMDET_RETINANET_MODEL_URL = "http://download.openmmlab.com/mmdetection/v2.0/retinanet/retinanet_r50_fpn_2x_coco/retinanet_r50_fpn_2x_coco_20200131-fdb43119.pth"
    MMDET_RETINANET_MODEL_PATH = "tests/data/models/mmdet/retinanet/retinanet_r50_fpn_2x_coco_20200131-fdb43119.pth"
    MMDET_YOLOX_TINY_MODEL_URL = "https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_tiny_8x8_300e_coco/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth"
    MMDET_YOLOX_TINY_MODEL_PATH = "tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth"

    MMDET_CASCADEMASKRCNN_CONFIG_PATH = "tests/data/models/mmdet/cascade_mask_rcnn/cascade-mask-rcnn_r50_fpn_1x_coco.py"
    MMDET_RETINANET_CONFIG_PATH = "tests/data/models/mmdet/retinanet/retinanet_r50_fpn_1x_coco.py"
    MMDET_YOLOX_TINY_CONFIG_PATH = "tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py"

The test was indeed on mmdet v2.0, how do you like to change this?

@fcakyon
Copy link
Collaborator

fcakyon commented Jun 4, 2024

@Alias-z you can drop the support for mmdet 2.0 and update it with mmdet 3.0 models/configs

@Alias-z
Copy link
Contributor Author

Alias-z commented Jun 4, 2024

Well, the CI test is tough ... @fcakyon

I initially used mmengine to combine all config inheritances into one config for the three test models; then I realized that there would many more code to modify. So i reverted back to current CI test configs, while updated has_mask method to be more universal:

Tested the new has_mask method on two object detectors and two instance segmentors:

  1. yolox_tiny_8x8_300e_coco, returned False
  2. 'retinanet_r50_fpn_1x_coco, returned False
  3. cascade-mask-rcnn_r50_fpn_1x_coco, returned True
  4. mask2former_swin-s-p4-w7-224_8xb2-lsj-50e_coco, returned True

So it should work now...

@fcakyon fcakyon merged commit 1660978 into obss:main Jun 7, 2024
9 checks passed
@fcakyon
Copy link
Collaborator

fcakyon commented Jun 7, 2024

@Alias-z a very elegant solution 💯

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