-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_cfg_det.py
84 lines (62 loc) · 2.31 KB
/
my_cfg_det.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
_base_ = [
'/content/mmocr/configs/_base_/default_runtime.py',
'/content/mmocr/configs/_base_/schedules/schedule_sgd_1200e.py',
'/content/mmocr/configs/_base_/det_models/dbnetpp_r50dcnv2_fpnc.py',
'/content/mmocr/configs/_base_/det_pipelines/dbnet_pipeline.py',
]
# The YML suggested the DBNetpp is with Training Resources: 1x Nvidia A100
# Location where the annotation and crop images are being stored
root='/content/wdr'
# Set up working dir to save files and logs.
work_dir =f'{root}/train_detect/base_dbnetpp'
train_root_custm1 ='/content/batch2_v2'
train_custm1 = dict( # This is the new one by
type='TextDetDataset',
img_prefix=train_root_custm1,
ann_file=f'{train_root_custm1}/mmocr_compatible_annotation/instances_training.txt',
loader=dict(
type='AnnFileLoader',
repeat=300,
file_format='txt',
parser=dict(
type='LineJsonParser',
keys=['file_name', 'height', 'width', 'annotations'])),
pipeline=None,
test_mode=False)
val_custm1 = dict( # This is the new one by
type='TextDetDataset',
img_prefix=train_root_custm1,
ann_file=f'{train_root_custm1}/mmocr_compatible_annotation/instances_training.txt',
loader=dict(
type='AnnFileLoader',
repeat=1,
file_format='txt',
parser=dict(
type='LineJsonParser',
keys=['file_name', 'height', 'width', 'annotations'])),
pipeline=None,
test_mode=False)
train_list = [train_custm1]
test_list = [val_custm1]
train_pipeline_r50dcnv2 = {{_base_.train_pipeline_r50dcnv2}}
test_pipeline_4068_1024 = {{_base_.test_pipeline_4068_1024}}
data = dict(
samples_per_gpu=16, # Default 32
workers_per_gpu=8,
val_dataloader=dict(samples_per_gpu=1),
test_dataloader=dict(samples_per_gpu=1),
train=dict(
type='UniformConcatDataset',
datasets=train_list,
pipeline=train_pipeline_r50dcnv2),
val=dict(
type='UniformConcatDataset',
datasets=test_list,
pipeline=test_pipeline_4068_1024),
test=dict(
type='UniformConcatDataset',
datasets=test_list,
pipeline=test_pipeline_4068_1024))
evaluation = dict(
interval=20,
metric='hmean-iou')