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

[Enhance] Replace data_dict calling 'img' key to support MMDet3D #514

Merged
merged 3 commits into from
Apr 29, 2021
Merged

[Enhance] Replace data_dict calling 'img' key to support MMDet3D #514

merged 3 commits into from
Apr 29, 2021

Conversation

Wuziyi616
Copy link
Contributor

Hi, I am Ziyi, a developer from MMDet3D. In order to train/test 3D seg algorithms, I need to call functions from MMSeg. However, some functions in MMSeg calls data['img'], which causes KeyError because we don't have img. I replace these calling with some workarounds and make it compatibility with MMDet3D. Hope you can approve it. Thanks.

@Wuziyi616 Wuziyi616 changed the title [Enhance] Remove data_dict calling 'img' key in some functions [Enhance] Replace data_dict calling 'img' key to support MMDet3D Apr 25, 2021
@codecov
Copy link

codecov bot commented Apr 25, 2021

Codecov Report

Merging #514 (b1a9bb6) into master (98ef5ac) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
+ Coverage   86.56%   86.60%   +0.04%     
==========================================
  Files          99       99              
  Lines        5164     5160       -4     
  Branches      836      834       -2     
==========================================
- Hits         4470     4469       -1     
+ Misses        535      533       -2     
+ Partials      159      158       -1     
Flag Coverage Δ
unittests 86.60% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
mmseg/models/segmentors/base.py 44.95% <ø> (ø)
mmseg/apis/test.py 22.68% <100.00%> (ø)
mmseg/models/builder.py 91.30% <0.00%> (+9.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98ef5ac...b1a9bb6. Read the comment docs.

mmseg/apis/test.py Outdated Show resolved Hide resolved
mmseg/apis/test.py Show resolved Hide resolved
@Wuziyi616 Wuziyi616 requested a review from xvjiarui April 26, 2021 07:50
@Wuziyi616
Copy link
Contributor Author

This PR is ready for review @xvjiarui. Thanks!

@@ -97,7 +97,7 @@ def single_gpu_test(model,
result = np2tmp(result)
results.append(result)

batch_size = data['img'][0].size(0)
batch_size = len(result)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xvjiarui xvjiarui merged commit 768f704 into open-mmlab:master Apr 29, 2021
@Wuziyi616 Wuziyi616 deleted the mmdet3d_compatibility branch April 29, 2021 08:12
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
…n-mmlab#514)

* remove dict calling img key for compatibility

* fix unit test

* infer batch size using len(result) to be consistent with mmcv
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this pull request Dec 3, 2023
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 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.

2 participants