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]: Use mmcv root model registry. #660

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

RangiLyu
Copy link
Member

Motivation

MMEditing did not use mmcv's MODELS registry as root/parent registry. This PR makes it impossible to build models across projects.

Modification

mmpose/models/registry.py

from mmcv.cnn import MODELS as MMCV_MODELS
from mmcv.utils import Registry

MODELS = Registry('model', parent=MMCV_MODELS)
BACKBONES = MODELS
COMPONENTS = MODELS
LOSSES = MODELS

MODELS = Registry(
    'models', build_func=build_model_from_cfg, parent=MMCV_MODELS)

@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #660 (2474414) into master (5170a64) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #660      +/-   ##
==========================================
+ Coverage   80.49%   80.51%   +0.01%     
==========================================
  Files         198      198              
  Lines       11233    11234       +1     
  Branches     1795     1795              
==========================================
+ Hits         9042     9045       +3     
+ Misses       1915     1914       -1     
+ Partials      276      275       -1     
Flag Coverage Δ
unittests 80.48% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
mmedit/__init__.py 50.00% <100.00%> (ø)
mmedit/models/registry.py 100.00% <100.00%> (ø)
...ls/components/stylegan2/generator_discriminator.py 86.14% <0.00%> (+1.20%) ⬆️

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 9d48e4e...2474414. Read the comment docs.

Copy link
Member

@wangruohui wangruohui left a comment

Choose a reason for hiding this comment

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

This modification will merge all three registries into a single one, which follows standard of other repos do.

@wangruohui wangruohui merged commit 9c9d690 into open-mmlab:master Dec 17, 2021
Yshuo-Li pushed a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
Yshuo-Li pushed a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 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.

2 participants