-
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
[Feature] Support computing mean scores in UniformConcatDataset #981
Conversation
Any other comments? If not, I'll start to update the configs. |
Wait a moment. I am still testing this code. |
I have some minor concerns about the current evaluation process:
In comparison, the det log prints details of each dataset in a clearer way. So the users can check the performance of a specific dataset easily.
Using the following toy data config to reproduce the issue root = 'tests/data/toy_dataset'
# dataset with type='TextDetDataset'
train1 = dict(
type='TextDetDataset',
img_prefix=f'{root}/imgs',
ann_file=f'{root}/instances_test.txt',
loader=dict(
type='HardDiskLoader',
repeat=4,
parser=dict(
type='LineJsonParser',
keys=['file_name', 'height', 'width', 'annotations'])),
pipeline=None,
test_mode=False)
# dataset with type='IcdarDataset'
train2 = dict(
type='IcdarDataset',
ann_file=f'{root}/instances_test.json',
img_prefix=f'{root}/imgs',
pipeline=None)
test = dict(
type='TextDetDataset',
img_prefix=f'{root}/imgs',
ann_file=f'{root}/instances_test.txt',
loader=dict(
type='HardDiskLoader',
repeat=1,
parser=dict(
type='LineJsonParser',
keys=['file_name', 'height', 'width', 'annotations'])),
pipeline=None,
test_mode=True)
train_list = [train1, train2]
test_list = [test, train2]
|
@xinke-wang Unfortunately, even though we can print the results for each dataset, there is no way to get rid of the summary at the end of the evaluation, which can lead to duplicate outputs. To streamline the evaluation report, I can make another PR after which users can choose the evaluation metric(s) to report by customizing the config. |
…-mmlab#981) * Get avg results in UniformConcatDataset * add docstr * Fix * fix test * fix typo
…-mmlab#981) * Get avg results in UniformConcatDataset * add docstr * Fix * fix test * fix typo
Motivation
Since text recognition models are usually evaluated on multiple datasets, it's hard to compare the model's performance across epochs without a unified indicator such as the mean scores. This PR supports
get_mean
inUniformConcatDataset
. When it's on, the mean score of{metric_name}
of concatenated datasets will be added to the evaluation results with the namemean_{metric_name}
.Modification
Modified
mmdet.datasets.ConcatDataset.evaluate()
to compute the mean scores when bothself.separate_eval
andself.get_mean
are True. Also disabled evaluating the datasets as a whole as this feature was not verified on MMOCR. We don't want to make excessive changes in this PR.Use case
To show the average results, set
show_mean_scores=True
indata.val
anddata.test
of the model's config: (e.g. inmmocr/configs/textrecog/crnn/crnn_academic_dataset.py
Lines 24 to 31 in 3188e53
BC-breaking (Optional)
No