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

Clean unnecessary custom_imports in entrypoints #6546

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

FloydHsiu
Copy link
Contributor

Motivation

According to #6543, MMCV already supports custom_imports since PR open-mmlab/mmcv#606. There is no need to manually handle custom_imports after calling Config.fromfile. So the code like below should be cleaned.

if cfg.get('custom_imports', None): 
     from mmcv.utils import import_modules_from_strings 
     import_modules_from_strings(**cfg['custom_imports']) 

Modification

  1. Search all files with related code

List of files with related code:

  • mmdet/core/export/pytorch2onnx.py
  • tools/analysis_tools/analyze_results.py
  • tools/analysis_tools/eval_metric.py
  • tools/analysis_tools/get_flops.py
  • tools/analysis_tools/test_robustness.py
  • tools/misc/browse_dataset.py
  • tools/misc/print_config.py
  • tools/test.py
  • tools/train.py
  1. delete the code in the list.

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2021

CLA assistant check)
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Nov 19, 2021

Codecov Report

Merging #6546 (4821a3d) into master (c76ab0e) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6546   +/-   ##
=======================================
  Coverage   62.04%   62.04%           
=======================================
  Files         319      319           
  Lines       25343    25340    -3     
  Branches     4194     4193    -1     
=======================================
- Hits        15723    15722    -1     
+ Misses       8794     8792    -2     
  Partials      826      826           
Flag Coverage Δ
unittests 62.01% <ø> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
mmdet/core/export/pytorch2onnx.py 14.81% <ø> (+0.77%) ⬆️
mmdet/core/bbox/samplers/random_sampler.py 75.00% <0.00%> (-5.56%) ⬇️
mmdet/core/bbox/assigners/max_iou_assigner.py 73.68% <0.00%> (+1.31%) ⬆️

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 c76ab0e...4821a3d. Read the comment docs.

@ZwwWayne ZwwWayne merged commit a7a16af into open-mmlab:master Nov 19, 2021
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
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.

4 participants