mirror of
https://github.com/open-mmlab/mmocr.git
synced 2025-06-03 21:54:47 +08:00
* refactor configs of textrecog * remove duplicate key in config _base_ * fix typo * rename dataset config file
57 lines
1.3 KiB
Python
Executable File
57 lines
1.3 KiB
Python
Executable File
dataset_type = 'OCRDataset'
|
|
|
|
root = 'tests/data/ocr_toy_dataset'
|
|
img_prefix = f'{root}/imgs'
|
|
train_anno_file1 = f'{root}/label.txt'
|
|
|
|
train1 = dict(
|
|
type=dataset_type,
|
|
img_prefix=img_prefix,
|
|
ann_file=train_anno_file1,
|
|
loader=dict(
|
|
type='HardDiskLoader',
|
|
repeat=100,
|
|
parser=dict(
|
|
type='LineStrParser',
|
|
keys=['filename', 'text'],
|
|
keys_idx=[0, 1],
|
|
separator=' ')),
|
|
pipeline=None,
|
|
test_mode=False)
|
|
|
|
train_anno_file2 = f'{root}/label.lmdb'
|
|
train2 = dict(
|
|
type=dataset_type,
|
|
img_prefix=img_prefix,
|
|
ann_file=train_anno_file2,
|
|
loader=dict(
|
|
type='LmdbLoader',
|
|
repeat=100,
|
|
parser=dict(
|
|
type='LineStrParser',
|
|
keys=['filename', 'text'],
|
|
keys_idx=[0, 1],
|
|
separator=' ')),
|
|
pipeline=None,
|
|
test_mode=False)
|
|
|
|
test_anno_file1 = f'{root}/label.lmdb'
|
|
test = dict(
|
|
type=dataset_type,
|
|
img_prefix=img_prefix,
|
|
ann_file=test_anno_file1,
|
|
loader=dict(
|
|
type='LmdbLoader',
|
|
repeat=1,
|
|
parser=dict(
|
|
type='LineStrParser',
|
|
keys=['filename', 'text'],
|
|
keys_idx=[0, 1],
|
|
separator=' ')),
|
|
pipeline=None,
|
|
test_mode=True)
|
|
|
|
train_list = [train1, train2]
|
|
|
|
test_list = [test]
|