-
Notifications
You must be signed in to change notification settings - Fork 156
/
test_base_setting.py
144 lines (130 loc) · 3.56 KB
/
test_base_setting.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : test_base_setting.py
# Abstract : Base recognition Model test setting
# Current Version: 1.0.0
# Date : 2021-06-11
##################################################################################################
"""
# encoding=utf-8
# recognition dictionary
character = "/path/to/demo/text_recognition/__dictionary__/Scene_text_68.txt"
# dataset settings
dataset_type = 'DavarMultiDataset'
img_norm_cfg = dict(
mean=[127.5], std=[127.5])
ppld = {
'LMDB_Standard': 'LoadImageFromLMDB', # open-source LMDB data
# Davar dataset type
'LMDB_Davar': 'RCGLoadImageFromLMDB',
'File': 'RCGLoadImageFromFile',
'Loose': 'RCGLoadImageFromLoose',
'Tight': 'RCGLoadImageFromTight',
}
test_pipeline = [
dict(type='LoadImageFromLMDB',
character=character,
sensitive=False,
color_types=['gray'],
fil_ops=True),
dict(type='ResizeNormalize',
size=(100, 32),
interpolation=2,
mean=[127.5],
std=[127.5]),
dict(type='DavarDefaultFormatBundle'),
dict(type='DavarCollect',
keys=['img'],
meta_keys=[])]
testsets = [
{
'Name': 'IIIT5k',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IIIT5k_3000/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'SVT',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'SVT/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC03_860',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC03_860/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC03_867',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC03_867/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC13_857',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC13_857/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC13_1015',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC13_1015/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC15_1811',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC15_1811/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'IC15_2077',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'IC15_2077/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'SVTP',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'SVTP/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
{
'Name': 'CUTE80',
'FilePre': '/path/to/evaluation/',
'AnnFile': 'CUTE80/',
'Type': 'LMDB_Standard',
'PipeLine': test_pipeline,
},
]
# data setting
data = dict(
imgs_per_gpu=400, # 128
workers_per_gpu=2, # 2
sampler=dict(
type='BatchBalancedSampler',
mode=0,),
train=None,
test=dict(
type="DavarRCGDataset",
info=testsets,
batch_max_length=25,
used_ratio=1,
test_mode=True,
pipeline=test_pipeline)
)
# runtime setting
dist_params = dict(backend='nccl')
launcher = 'none'