-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_cfg.py
72 lines (56 loc) · 2.41 KB
/
my_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
_base_ = [
'/mmocr/configs/_base_/recog_models/sar.py',
'/mmocr/configs/_base_/recog_pipelines/sar_pipeline.py',
'/mmocr/configs/_base_/schedules/schedule_adam_step_5e.py',
'/mmocr/configs/_base_/default_runtime.py',
]
train_pipeline = {{_base_.train_pipeline}}
test_pipeline = {{_base_.test_pipeline}}
work_dir = '/mmocr/demo/tutorial_exps'
dataset_type = 'OCRDataset'
root = '/mmocr/tests/data/toy_dataset' # Location where the annotation and crop images are being stored
img_prefix ='/mmocr/tests/data/toy_dataset/crops'
train_anno_file1 = '/mmocr/tests/data/toy_dataset/train_label.jsonl'
loader_dt_train = dict(type='AnnFileLoader',
repeat=100,
file_format='txt', # only txt and lmdb
file_storage_backend='disk',
parser=dict(type='LineJsonParser',
keys=['filename', 'text']))
train_datasets1 = dict(type='OCRDataset',
img_prefix=img_prefix,
ann_file=train_anno_file1,
loader=loader_dt_train,
pipeline=None,
test_mode=False)
loader_dt_val = dict(type='AnnFileLoader',
repeat=1,
file_format='txt', # only txt and lmdb
file_storage_backend='disk',
parser=dict(type='LineJsonParser',
keys=['filename', 'text']))
val_datasets1 = dict(type='OCRDataset',
img_prefix=img_prefix,
ann_file=train_anno_file1,
loader=loader_dt_val,
pipeline=None,
test_mode=False)
train_list = [train_datasets1]
test_list = [val_datasets1]
data = dict(
workers_per_gpu=2,
samples_per_gpu=8,
train=dict(
type='UniformConcatDataset',
datasets=train_list,
pipeline=train_pipeline),
val=dict(
type='UniformConcatDataset',
datasets=test_list,
pipeline=test_pipeline),
test=dict(
type='UniformConcatDataset',
datasets=test_list,
pipeline=test_pipeline)
)
evaluation = dict(interval=1, metric='acc')