-
Notifications
You must be signed in to change notification settings - Fork 156
/
lgpma_pub.py
52 lines (43 loc) · 1.53 KB
/
lgpma_pub.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
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : lgpma_pub.py
# Abstract : Model settings for LGPMA detector on PubTabNet
# Current Version: 1.0.1
# Date : 2022-09-05
##################################################################################################
"""
_base_ = "./lgpma_base.py"
data = dict(
samples_per_gpu=3,
workers_per_gpu=1,
train=dict(
ann_file='path/to/PubTabNet_datalist_train_detection.json',
img_prefix='path/to/PubTabNet'),
# According to the evaluation metric, select the appropriate validation dataset format.
val=dict(
ann_file='path/to/validation.json',
img_prefix='path/to/PubTabNet'),
test=dict(
samples_per_gpu=1,
ann_file='path/to/PubTabNet_2.0.0_val.jsonl',
img_prefix='path/to/PubTabNet/Images/val/')
)
# yapf:enable
# runtime settings
checkpoint_config = dict(interval=1, filename_tmpl='checkpoint/maskrcnn-lgpma-pub-e{}.pth')
work_dir = 'path/to/workdir'
# Online evaluation or batch evaluation
evaluation_metric = "TEDS" # change to "hmean" for aligned bboxes evaluation
evaluation = dict(
eval_func_params=dict(
ENLARGE_ANN_BBOXES=True,
IOU_CONSTRAINT=0.5
),
metric=evaluation_metric,
by_epoch=True,
interval=1,
eval_mode="general",
save_best=evaluation_metric,
rule='greater',
)