-
Notifications
You must be signed in to change notification settings - Fork 755
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
[Refactor] refactor transformer modules #618
Conversation
Codecov Report
@@ Coverage Diff @@
## main #618 +/- ##
==========================================
+ Coverage 84.92% 85.22% +0.30%
==========================================
Files 143 145 +2
Lines 9810 9856 +46
Branches 1469 1482 +13
==========================================
+ Hits 8331 8400 +69
+ Misses 1150 1128 -22
+ Partials 329 328 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f176748
to
dea18de
Compare
58ed483
to
21ed095
Compare
mmocr/apis/inference.py
Outdated
dataset_type = cfg.data[set_type].type | ||
if dataset_type in ['OCRDataset', 'OCRSegDataset']: | ||
if cfg.data[set_type].pipeline[1].type == 'MultiRotateAugOCR': | ||
warnings.warn(warning_msg) | ||
cfg.data[set_type].pipeline = [ | ||
cfg.data[set_type].pipeline[0], | ||
*cfg.data[set_type].pipeline[1].transforms | ||
] | ||
elif dataset_type == 'ConcatDataset': | ||
for dataset in cfg.data[set_type].datasets: | ||
if dataset.pipeline[1].type == 'MultiRotateAugOCR': | ||
warnings.warn(warning_msg) | ||
dataset.pipeline = [ | ||
dataset.pipeline[0], *dataset.pipeline[1].transforms | ||
] | ||
elif dataset_type == 'UniformConcatDataset': | ||
uniform_pipeline = cfg.data[set_type].pipeline | ||
if uniform_pipeline is not None: | ||
if uniform_pipeline[1].type == 'MultiRotateAugOCR': | ||
warnings.warn(warning_msg) | ||
cfg.data[set_type].pipeline = [ | ||
uniform_pipeline[0], *uniform_pipeline[1].transforms | ||
] | ||
for dataset in cfg.data[set_type].datasets: | ||
if dataset.pipeline is not None: | ||
if dataset.pipeline[1].type == 'MultiRotateAugOCR': | ||
warnings.warn(warning_msg) | ||
dataset.pipeline = [ | ||
dataset.pipeline[0], | ||
*dataset.pipeline[1].transforms | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay but also a bit ugly. @Harold-lkk any refactor suggestion?
* base refactor * update config * modify implementation of nrtr * add config file * add mask * add operation order * fix contiguous bug * update config * fix pytest * fix pytest * update readme * update readme and metafile * update docstring * fix norm cfg and dict size * rm useless * use mmocr builder instead * update pytest * update * remove useless * fix ckpt name * fix path * include all config file into pytest * update inference * Update test_recog_config.py
* base refactor * update config * modify implementation of nrtr * add config file * add mask * add operation order * fix contiguous bug * update config * fix pytest * fix pytest * update readme * update readme and metafile * update docstring * fix norm cfg and dict size * rm useless * use mmocr builder instead * update pytest * update * remove useless * fix ckpt name * fix path * include all config file into pytest * update inference * Update test_recog_config.py
models/common
NRTR
model