This commit is contained in:
40
benchmark/PaddleOCR_DBNet/config/SynthText.yaml
Normal file
40
benchmark/PaddleOCR_DBNet/config/SynthText.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: DBNet
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
type: SynthTextDataset # 数据集类型
|
||||
args:
|
||||
data_path: ''# SynthTextDataset 根目录
|
||||
pre_processes: # 数据的预处理过程,包含augment和标签制作
|
||||
- type: IaaAugment # 使用imgaug进行变换
|
||||
args:
|
||||
- {'type':Fliplr, 'args':{'p':0.5}}
|
||||
- {'type': Affine, 'args':{'rotate':[-10,10]}}
|
||||
- {'type':Resize,'args':{'size':[0.5,3]}}
|
||||
- type: EastRandomCropData
|
||||
args:
|
||||
size: [640,640]
|
||||
max_tries: 50
|
||||
keep_ratio: true
|
||||
- type: MakeBorderMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
- type: MakeShrinkMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
min_text_size: 8
|
||||
transforms: # 对图片进行的变换方式
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
filter_keys: ['img_path','img_name','text_polys','texts','ignore_tags','shape'] # 返回数据之前,从数据字典里删除的key
|
||||
ignore_tags: ['*', '###']
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 0
|
||||
collate_fn: ''
|
||||
@@ -0,0 +1,65 @@
|
||||
name: DBNet
|
||||
base: ['config/SynthText.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 10
|
||||
show_images_iter: 50
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path: ./datasets/SynthText
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 2
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
69
benchmark/PaddleOCR_DBNet/config/icdar2015.yaml
Normal file
69
benchmark/PaddleOCR_DBNet/config/icdar2015.yaml
Normal file
@@ -0,0 +1,69 @@
|
||||
name: DBNet
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
type: ICDAR2015Dataset # 数据集类型
|
||||
args:
|
||||
data_path: # 一个存放 img_path \t gt_path的文件
|
||||
- ''
|
||||
pre_processes: # 数据的预处理过程,包含augment和标签制作
|
||||
- type: IaaAugment # 使用imgaug进行变换
|
||||
args:
|
||||
- {'type':Fliplr, 'args':{'p':0.5}}
|
||||
- {'type': Affine, 'args':{'rotate':[-10,10]}}
|
||||
- {'type':Resize,'args':{'size':[0.5,3]}}
|
||||
- type: EastRandomCropData
|
||||
args:
|
||||
size: [640,640]
|
||||
max_tries: 50
|
||||
keep_ratio: true
|
||||
- type: MakeBorderMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
thresh_min: 0.3
|
||||
thresh_max: 0.7
|
||||
- type: MakeShrinkMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
min_text_size: 8
|
||||
transforms: # 对图片进行的变换方式
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
filter_keys: [img_path,img_name,text_polys,texts,ignore_tags,shape] # 返回数据之前,从数据字典里删除的key
|
||||
ignore_tags: ['*', '###']
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 0
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
type: ICDAR2015Dataset
|
||||
args:
|
||||
data_path:
|
||||
- ''
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
transforms:
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
filter_keys: []
|
||||
ignore_tags: ['*', '###']
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 0
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,82 @@
|
||||
name: DBNet
|
||||
base: ['config/icdar2015.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: deformable_resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 10
|
||||
show_images_iter: 50
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.txt
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.txt
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,82 @@
|
||||
name: DBNet
|
||||
base: ['config/icdar2015.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 10
|
||||
show_images_iter: 50
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.txt
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.txt
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,83 @@
|
||||
name: DBNet
|
||||
base: ['config/icdar2015.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: StepLR
|
||||
args:
|
||||
step_size: 10
|
||||
gama: 0.8
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 500
|
||||
log_iter: 10
|
||||
show_images_iter: 50
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.txt
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.txt
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,79 @@
|
||||
name: DBNet
|
||||
base: ['config/icdar2015.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnet50
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
lr_scheduler:
|
||||
type: Polynomial
|
||||
args:
|
||||
learning_rate: 0.001
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 10
|
||||
show_images_iter: 50
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output/fp16_o2
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.txt
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 16
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.txt
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
73
benchmark/PaddleOCR_DBNet/config/open_dataset.yaml
Normal file
73
benchmark/PaddleOCR_DBNet/config/open_dataset.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
name: DBNet
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
type: DetDataset # 数据集类型
|
||||
args:
|
||||
data_path: # 一个存放 img_path \t gt_path的文件
|
||||
- ''
|
||||
pre_processes: # 数据的预处理过程,包含augment和标签制作
|
||||
- type: IaaAugment # 使用imgaug进行变换
|
||||
args:
|
||||
- {'type':Fliplr, 'args':{'p':0.5}}
|
||||
- {'type': Affine, 'args':{'rotate':[-10,10]}}
|
||||
- {'type':Resize,'args':{'size':[0.5,3]}}
|
||||
- type: EastRandomCropData
|
||||
args:
|
||||
size: [640,640]
|
||||
max_tries: 50
|
||||
keep_ratio: true
|
||||
- type: MakeBorderMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
thresh_min: 0.3
|
||||
thresh_max: 0.7
|
||||
- type: MakeShrinkMap
|
||||
args:
|
||||
shrink_ratio: 0.4
|
||||
min_text_size: 8
|
||||
transforms: # 对图片进行的变换方式
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
filter_keys: [img_path,img_name,text_polys,texts,ignore_tags,shape] # 返回数据之前,从数据字典里删除的key
|
||||
ignore_tags: ['*', '###']
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 0
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
type: DetDataset
|
||||
args:
|
||||
data_path:
|
||||
- ''
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
transforms:
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
load_char_annotation: false # 是否加载字符级标注
|
||||
expand_one_char: false # 是否对只有一个字符的框进行宽度扩充,扩充后w = w+h
|
||||
filter_keys: []
|
||||
ignore_tags: ['*', '###']
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 0
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,86 @@
|
||||
name: DBNet
|
||||
base: ['config/open_dataset.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: deformable_resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 1
|
||||
show_images_iter: 1
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.json
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 2
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.json
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,86 @@
|
||||
name: DBNet
|
||||
base: ['config/open_dataset.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnest50
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 1
|
||||
show_images_iter: 1
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.json
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 2
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.json
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
@@ -0,0 +1,93 @@
|
||||
name: DBNet
|
||||
base: ['config/open_dataset.yaml']
|
||||
arch:
|
||||
type: Model
|
||||
backbone:
|
||||
type: resnet18
|
||||
pretrained: true
|
||||
neck:
|
||||
type: FPN
|
||||
inner_channels: 256
|
||||
head:
|
||||
type: DBHead
|
||||
out_channels: 2
|
||||
k: 50
|
||||
post_processing:
|
||||
type: SegDetectorRepresenter
|
||||
args:
|
||||
thresh: 0.3
|
||||
box_thresh: 0.7
|
||||
max_candidates: 1000
|
||||
unclip_ratio: 1.5 # from paper
|
||||
metric:
|
||||
type: QuadMetric
|
||||
args:
|
||||
is_output_polygon: false
|
||||
loss:
|
||||
type: DBLoss
|
||||
alpha: 1
|
||||
beta: 10
|
||||
ohem_ratio: 3
|
||||
optimizer:
|
||||
type: Adam
|
||||
args:
|
||||
lr: 0.001
|
||||
weight_decay: 0
|
||||
amsgrad: true
|
||||
lr_scheduler:
|
||||
type: WarmupPolyLR
|
||||
args:
|
||||
warmup_epoch: 3
|
||||
trainer:
|
||||
seed: 2
|
||||
epochs: 1200
|
||||
log_iter: 1
|
||||
show_images_iter: 1
|
||||
resume_checkpoint: ''
|
||||
finetune_checkpoint: ''
|
||||
output_dir: output
|
||||
visual_dl: false
|
||||
amp:
|
||||
scale_loss: 1024
|
||||
amp_level: O2
|
||||
custom_white_list: []
|
||||
custom_black_list: ['exp', 'sigmoid', 'concat']
|
||||
dataset:
|
||||
train:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/train.json
|
||||
transforms: # 对图片进行的变换方式
|
||||
- type: ToTensor
|
||||
args: {}
|
||||
- type: Normalize
|
||||
args:
|
||||
mean: [0.485, 0.456, 0.406]
|
||||
std: [0.229, 0.224, 0.225]
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 2
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ''
|
||||
validate:
|
||||
dataset:
|
||||
args:
|
||||
data_path:
|
||||
- ./datasets/test.json
|
||||
pre_processes:
|
||||
- type: ResizeShortSize
|
||||
args:
|
||||
short_size: 736
|
||||
resize_text_polys: false
|
||||
img_mode: RGB
|
||||
load_char_annotation: false
|
||||
expand_one_char: false
|
||||
loader:
|
||||
batch_size: 1
|
||||
shuffle: true
|
||||
num_workers: 6
|
||||
collate_fn: ICDARCollectFN
|
||||
Reference in New Issue
Block a user