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

[Bugfix] test resize with pad_shape #3421

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

okotaku
Copy link
Contributor

@okotaku okotaku commented Nov 6, 2023

Motivation

When using test_cfg for data_preprocessor, predict_by_feat resizes to the original size, not the padded size.

data_preprocessor = dict(
    type="SegDataPreProcessor",
    #type="SegDataPreProcessorWithPad",
    mean=[123.675, 116.28, 103.53],
    std=[58.395, 57.12, 57.375],
    bgr_to_rgb=True,
    pad_val=0,
    seg_pad_val=255,
    test_cfg=dict(size=(128, 128)))

Refar to:
https://github.com/open-mmlab/mmsegmentation/blob/main/mmseg/models/decode_heads/san_head.py#L589-L592

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 MMDet3D.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Nov 6, 2023

CLA assistant check
All committers have signed the CLA.

@xiexinch xiexinch changed the base branch from main to dev-1.x December 7, 2023 06:03
@xiexinch xiexinch merged commit 7451459 into open-mmlab:dev-1.x Dec 7, 2023
8 of 10 checks passed
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
## Motivation

When using `test_cfg` for `data_preprocessor`, `predict_by_feat` resizes
to the original size, not the padded size.

```
data_preprocessor = dict(
    type="SegDataPreProcessor",
    #type="SegDataPreProcessorWithPad",
    mean=[123.675, 116.28, 103.53],
    std=[58.395, 57.12, 57.375],
    bgr_to_rgb=True,
    pad_val=0,
    seg_pad_val=255,
    test_cfg=dict(size=(128, 128)))
```

Refar to:

https://github.com/open-mmlab/mmsegmentation/blob/main/mmseg/models/decode_heads/san_head.py#L589-L592

## 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
MMDet3D.
4. The documentation has been modified accordingly, like docstring or
example tutorials.
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.

None yet

3 participants