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

[Fix]Add input argument for datasets #2379

Merged
merged 1 commit into from Dec 5, 2022

Conversation

MeowZheng
Copy link
Collaborator

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

before this modification, the key-word arguments don't allow input, like

class ADE20KDataset(BaseSegDataset):

    def __init__(self, **kwargs) -> None:

        super().__init__(
            img_suffix='.jpg',
            seg_map_suffix='.png',
            reduce_zero_label=True,
            **kwargs)

It would not allow img_suffix and seg_map_suffix, and raise TypeError: __init__() got multiple values for keyword argument 'img_suffix'

ADE20KDataset(data_root = 'data/ade/ADEChallengeData2016',
   ...:     data_prefix=dict(img_path='images/training', seg_map_path='annotations/training'),
   ...:     img_suffix='.jpg',
   ...:     seg_map_suffix='.png')

Modification

  • Add default values __init__
  • Remove default inputs supper().__init__()

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

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.

@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Base: 83.67% // Head: 83.33% // Decreases project coverage by -0.33% ⚠️

Coverage data is based on head (43d2172) compared to base (721afae).
Patch coverage: 92.76% of modified lines in pull request are covered.

❗ Current head 43d2172 differs from pull request most recent head f0bc075. Consider uploading reports for the commit f0bc075 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2379      +/-   ##
===========================================
- Coverage    83.67%   83.33%   -0.34%     
===========================================
  Files          141      143       +2     
  Lines         8001     8127     +126     
  Branches      1198     1211      +13     
===========================================
+ Hits          6695     6773      +78     
- Misses        1115     1165      +50     
+ Partials       191      189       -2     
Flag Coverage Δ
unittests 83.33% <92.76%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/models/decode_heads/knet_head.py 14.04% <0.00%> (ø)
mmseg/models/decode_heads/mask2former_head.py 89.65% <89.65%> (ø)
mmseg/models/decode_heads/maskformer_head.py 93.75% <93.75%> (ø)
mmseg/datasets/ade.py 100.00% <100.00%> (ø)
mmseg/datasets/chase_db1.py 75.00% <100.00%> (ø)
mmseg/datasets/coco_stuff.py 85.71% <100.00%> (ø)
mmseg/datasets/dark_zurich.py 83.33% <100.00%> (ø)
mmseg/datasets/drive.py 75.00% <100.00%> (ø)
mmseg/datasets/hrf.py 75.00% <100.00%> (ø)
mmseg/datasets/isaid.py 100.00% <100.00%> (ø)
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MeowZheng MeowZheng merged commit f3db8d7 into open-mmlab:dev-1.x Dec 5, 2022
@MeowZheng MeowZheng deleted the dataset_inputarg branch December 5, 2022 14:27
MeowZheng added a commit to MeowZheng/mmsegmentation that referenced this pull request Dec 30, 2022
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
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

2 participants