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

[Refactor] Refactor icdardataset metainfo to lowercase. #1620

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mmocr/datasets/icdar_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IcdarDataset(CocoDataset):
None img. The maximum extra number of cycles to get a valid
image. Defaults to 1000.
"""
METAINFO = {'CLASSES': ('text', )}
METAINFO = {'classes': ('text', )}

def parse_data_info(self, raw_data_info: dict) -> Union[dict, List[dict]]:
"""Parse raw annotation to target format.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_datasets/test_icdar_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _create_dummy_icdar_json(self, json_name):
'categories':
categories
}
self.metainfo = dict(CLASSES=('text'))
self.metainfo = dict(classes=('text'))
mmengine.dump(fake_json, json_name)

def test_icdar_dataset(self):
Expand All @@ -130,7 +130,7 @@ def test_icdar_dataset(self):
data_prefix=dict(img_path='imgs'),
metainfo=self.metainfo,
pipeline=[])
self.assertEqual(dataset.metainfo['CLASSES'], self.metainfo['CLASSES'])
self.assertEqual(dataset.metainfo['classes'], self.metainfo['classes'])
dataset.full_init()
self.assertEqual(len(dataset), 2)
self.assertEqual(len(dataset.load_data_list()), 2)
Expand Down