Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
42230e04
Unverified
Commit
42230e04
authored
Dec 07, 2021
by
MissPenguin
Committed by
GitHub
Dec 07, 2021
Browse files
Merge pull request #4856 from LDOUBLEV/tipc_test_allclose
fix finite
parents
826b4216
67c0a67b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
18 deletions
+15
-18
test_tipc/configs/det_r50_vd_sast_icdar15_v2.0/det_r50_vd_sast_icdar2015.yml
...et_r50_vd_sast_icdar15_v2.0/det_r50_vd_sast_icdar2015.yml
+1
-1
test_tipc/configs/en_server_pgnetA/train_infer_python.txt
test_tipc/configs/en_server_pgnetA/train_infer_python.txt
+2
-2
test_tipc/prepare.sh
test_tipc/prepare.sh
+7
-7
tools/infer/utility.py
tools/infer/utility.py
+5
-8
No files found.
test_tipc/configs/det_r50_vd_sast_icdar15_v2.0/det_r50_vd_sast_icdar2015.yml
View file @
42230e04
...
@@ -62,7 +62,7 @@ Train:
...
@@ -62,7 +62,7 @@ Train:
data_dir
:
./train_data/icdar2015/text_localization/
data_dir
:
./train_data/icdar2015/text_localization/
label_file_list
:
label_file_list
:
-
./train_data/icdar2015/text_localization/train_icdar2015_label.txt
-
./train_data/icdar2015/text_localization/train_icdar2015_label.txt
ratio_list
:
[
0.1
,
0.45
,
0.3
,
0.15
]
ratio_list
:
[
1.0
]
transforms
:
transforms
:
-
DecodeImage
:
# load image
-
DecodeImage
:
# load image
img_mode
:
BGR
img_mode
:
BGR
...
...
test_tipc/configs/en_server_pgnetA/train_infer_python.txt
View file @
42230e04
...
@@ -4,7 +4,7 @@ python:python3.7
...
@@ -4,7 +4,7 @@ python:python3.7
gpu_list:0|0,1
gpu_list:0|0,1
Global.use_gpu:True|True
Global.use_gpu:True|True
Global.auto_cast:null
Global.auto_cast:null
Global.epoch_num:lite_train_lite_infer=
1
|whole_train_whole_infer=500
Global.epoch_num:lite_train_lite_infer=
5
|whole_train_whole_infer=500
Global.save_model_dir:./output/
Global.save_model_dir:./output/
Train.loader.batch_size_per_card:lite_train_lite_infer=2|whole_train_whole_infer=14
Train.loader.batch_size_per_card:lite_train_lite_infer=2|whole_train_whole_infer=14
Global.pretrained_model:null
Global.pretrained_model:null
...
@@ -42,7 +42,7 @@ inference:tools/infer/predict_e2e.py
...
@@ -42,7 +42,7 @@ inference:tools/infer/predict_e2e.py
--enable_mkldnn:True|False
--enable_mkldnn:True|False
--cpu_threads:1|6
--cpu_threads:1|6
--rec_batch_num:1
--rec_batch_num:1
--use_tensorrt:False
|True
--use_tensorrt:False
--precision:fp32|fp16|int8
--precision:fp32|fp16|int8
--e2e_model_dir:
--e2e_model_dir:
--image_dir:./inference/ch_det_data_50/all-sum-510/
--image_dir:./inference/ch_det_data_50/all-sum-510/
...
...
test_tipc/prepare.sh
View file @
42230e04
...
@@ -25,7 +25,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
...
@@ -25,7 +25,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
# pretrain lite train data
# pretrain lite train data
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
if
[
${
model_name
}
=
=
"ch_PPOCRv2_det"
]
;
then
if
[
${
model_name
}
=
~
"ch_PPOCRv2_det"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_distill_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv2_det_distill_train.tar
&&
cd
../
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv2_det_distill_train.tar
&&
cd
../
fi
fi
...
@@ -50,7 +50,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
...
@@ -50,7 +50,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
if
[
${
model_name
}
==
"det_r50_vd_sast_icdar15_v2.0"
]
||
[
${
model_name
}
==
"det_r50_vd_sast_totaltext_v2.0"
]
;
then
if
[
${
model_name
}
==
"det_r50_vd_sast_icdar15_v2.0"
]
||
[
${
model_name
}
==
"det_r50_vd_sast_totaltext_v2.0"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./train_data/ wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar
--no-check-certificate
wget
-nc
-P
./train_data/ wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar
--no-check-certificate
cd
./train_data
&&
tar
xf total_text_lite.tar
&&
ln
-s
total_text
&&
cd
../
cd
./train_data
&&
tar
xf total_text_lite.tar
&&
ln
-s
total_text
_lite total_text
&&
cd
../
fi
fi
if
[
${
model_name
}
==
"det_mv3_db_v2.0"
]
;
then
if
[
${
model_name
}
==
"det_mv3_db_v2.0"
]
;
then
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
...
@@ -78,15 +78,15 @@ elif [ ${MODE} = "whole_train_whole_infer" ];then
...
@@ -78,15 +78,15 @@ elif [ ${MODE} = "whole_train_whole_infer" ];then
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv2_det_distill_train.tar
&&
cd
../
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv2_det_distill_train.tar
&&
cd
../
fi
fi
if
[
${
model_name
}
==
"en_server_pgnetA"
]
;
then
if
[
${
model_name
}
==
"en_server_pgnetA"
]
;
then
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/d
atase
t/total_text.tar
--no-check-certificate
wget
-nc
-P
./train_data/
https://paddleocr.bj.bcebos.com/d
ygraph_v2.0/tes
t/total_text
_lite
.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/en_server_pgnetA.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf en_server_pgnetA.tar
&&
cd
../
cd
./pretrain_models/
&&
tar
xf en_server_pgnetA.tar
&&
cd
../
cd
./train_data
&&
tar
xf total_text.tar
&&
ln
-s
total_text
&&
cd
../
cd
./train_data
&&
tar
xf total_text.tar
&&
ln
-s
total_text
_lite total_text
&&
cd
../
fi
fi
if
[
${
model_name
}
==
"det_r50_vd_sast_totaltext_v2.0"
]
;
then
if
[
${
model_name
}
==
"det_r50_vd_sast_totaltext_v2.0"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/d
atase
t/total_text.tar
--no-check-certificate
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/d
ygraph_v2.0/tes
t/total_text
_lite
.tar
--no-check-certificate
cd
./train_data
&&
tar
xf total_text.tar
&&
ln
-s
total_text
&&
cd
../
cd
./train_data
&&
tar
xf total_text.tar
&&
ln
-s
total_text
_lite total_text
&&
cd
../
fi
fi
elif
[
${
MODE
}
=
"lite_train_whole_infer"
]
;
then
elif
[
${
MODE
}
=
"lite_train_whole_infer"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
--no-check-certificate
...
@@ -135,7 +135,7 @@ elif [ ${MODE} = "whole_infer" ];then
...
@@ -135,7 +135,7 @@ elif [ ${MODE} = "whole_infer" ];then
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar
--no-check-certificate
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar
--no-check-certificate
cd
./inference
&&
tar
xf
${
eval_model_name
}
.tar
&&
tar
xf rec_inference.tar
&&
cd
../
cd
./inference
&&
tar
xf
${
eval_model_name
}
.tar
&&
tar
xf rec_inference.tar
&&
cd
../
fi
fi
if
[
${
model_name
}
=
"ch_PPOCRv2_det"
]
;
then
if
[
${
model_name
}
=
~
"ch_PPOCRv2_det"
]
;
then
eval_model_name
=
"ch_PP-OCRv2_det_infer"
eval_model_name
=
"ch_PP-OCRv2_det_infer"
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
--no-check-certificate
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
--no-check-certificate
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar
--no-check-certificate
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar
--no-check-certificate
...
...
tools/infer/utility.py
View file @
42230e04
...
@@ -195,6 +195,7 @@ def create_predictor(args, mode, logger):
...
@@ -195,6 +195,7 @@ def create_predictor(args, mode, logger):
max_batch_size
=
args
.
max_batch_size
,
max_batch_size
=
args
.
max_batch_size
,
min_subgraph_size
=
args
.
min_subgraph_size
)
min_subgraph_size
=
args
.
min_subgraph_size
)
# skip the minmum trt subgraph
# skip the minmum trt subgraph
use_dynamic_shape
=
True
if
mode
==
"det"
:
if
mode
==
"det"
:
min_input_shape
=
{
min_input_shape
=
{
"x"
:
[
1
,
3
,
50
,
50
],
"x"
:
[
1
,
3
,
50
,
50
],
...
@@ -260,6 +261,8 @@ def create_predictor(args, mode, logger):
...
@@ -260,6 +261,8 @@ def create_predictor(args, mode, logger):
max_input_shape
.
update
(
max_pact_shape
)
max_input_shape
.
update
(
max_pact_shape
)
opt_input_shape
.
update
(
opt_pact_shape
)
opt_input_shape
.
update
(
opt_pact_shape
)
elif
mode
==
"rec"
:
elif
mode
==
"rec"
:
if
args
.
rec_algorithm
!=
"CRNN"
:
use_dynamic_shape
=
False
min_input_shape
=
{
"x"
:
[
1
,
3
,
32
,
10
]}
min_input_shape
=
{
"x"
:
[
1
,
3
,
32
,
10
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
1536
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
1536
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
320
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
32
,
320
]}
...
@@ -268,14 +271,8 @@ def create_predictor(args, mode, logger):
...
@@ -268,14 +271,8 @@ def create_predictor(args, mode, logger):
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
1024
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
1024
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
320
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
48
,
320
]}
else
:
else
:
min_input_shape
=
{
"x"
:
[
1
,
3
,
10
,
10
]}
use_dynamic_shape
=
False
max_input_shape
=
{
"x"
:
[
1
,
3
,
512
,
512
]}
if
use_dynamic_shape
:
opt_input_shape
=
{
"x"
:
[
1
,
3
,
256
,
256
]}
if
mode
==
"rec"
:
if
args
.
rec_algorithm
==
"CRNN"
:
config
.
set_trt_dynamic_shape_info
(
min_input_shape
,
max_input_shape
,
opt_input_shape
)
else
:
config
.
set_trt_dynamic_shape_info
(
config
.
set_trt_dynamic_shape_info
(
min_input_shape
,
max_input_shape
,
opt_input_shape
)
min_input_shape
,
max_input_shape
,
opt_input_shape
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment