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
71d37bab
Commit
71d37bab
authored
Mar 23, 2022
by
Leif
Browse files
Merge remote-tracking branch 'Evezerest/dygraph' into dygraph
parents
8e32ef41
fbb68c38
Changes
161
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
66 additions
and
33 deletions
+66
-33
test_tipc/test_inference_cpp.sh
test_tipc/test_inference_cpp.sh
+1
-1
test_tipc/test_serving.sh
test_tipc/test_serving.sh
+18
-12
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+1
-1
tools/eval.py
tools/eval.py
+0
-1
tools/export_model.py
tools/export_model.py
+6
-0
tools/infer/predict_cls.py
tools/infer/predict_cls.py
+1
-1
tools/infer/predict_det.py
tools/infer/predict_det.py
+19
-4
tools/infer/predict_e2e.py
tools/infer/predict_e2e.py
+1
-1
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+1
-1
tools/infer/predict_system.py
tools/infer/predict_system.py
+1
-1
tools/infer/utility.py
tools/infer/utility.py
+8
-1
tools/infer_cls.py
tools/infer_cls.py
+1
-1
tools/infer_det.py
tools/infer_det.py
+1
-1
tools/infer_e2e.py
tools/infer_e2e.py
+1
-1
tools/infer_kie.py
tools/infer_kie.py
+1
-1
tools/infer_rec.py
tools/infer_rec.py
+1
-1
tools/infer_table.py
tools/infer_table.py
+1
-1
tools/infer_vqa_token_ser.py
tools/infer_vqa_token_ser.py
+1
-1
tools/infer_vqa_token_ser_re.py
tools/infer_vqa_token_ser_re.py
+1
-1
tools/program.py
tools/program.py
+1
-1
No files found.
test_tipc/test_inference_cpp.sh
View file @
71d37bab
...
@@ -150,7 +150,7 @@ if [ ${use_opencv} = "True" ]; then
...
@@ -150,7 +150,7 @@ if [ ${use_opencv} = "True" ]; then
make
-j
make
-j
make
install
make
install
cd
../
cd
../
..
echo
"################### build opencv finished ###################"
echo
"################### build opencv finished ###################"
fi
fi
fi
fi
...
...
test_tipc/test_serving.sh
View file @
71d37bab
...
@@ -58,29 +58,32 @@ function func_serving(){
...
@@ -58,29 +58,32 @@ function func_serving(){
trans_model_cmd
=
"
${
python_list
[0]
}
${
trans_model_py
}
${
set_dirname
}
${
set_model_filename
}
${
set_params_filename
}
${
set_serving_server
}
${
set_serving_client
}
"
trans_model_cmd
=
"
${
python_list
[0]
}
${
trans_model_py
}
${
set_dirname
}
${
set_model_filename
}
${
set_params_filename
}
${
set_serving_server
}
${
set_serving_client
}
"
eval
$trans_model_cmd
eval
$trans_model_cmd
cd
${
serving_dir_value
}
cd
${
serving_dir_value
}
echo
$PWD
unset
https_proxy
unset
https_proxy
unset
http_proxy
unset
http_proxy
for
python
in
${
python_list
[*]
}
;
do
for
python
in
${
python_list
[*]
}
;
do
if
[
${
python
}
=
"cpp"
]
;
then
if
[
${
python
}
=
"cpp"
]
;
then
for
use_gpu
in
${
web_use_gpu_list
[*]
}
;
do
for
use_gpu
in
${
web_use_gpu_list
[*]
}
;
do
if
[
${
use_gpu
}
=
"null"
]
;
then
if
[
${
use_gpu
}
=
"null"
]
;
then
web_service_cpp_cmd
=
"
${
python
}
-m paddle_serving_server.serve --model ppocr_det_mobile_2.0_serving/ ppocr_rec_mobile_2.0_serving/ --port 9293"
web_service_cpp_cmd
=
"
${
python_list
[0]
}
-m paddle_serving_server.serve --model ppocr_det_mobile_2.0_serving/ ppocr_rec_mobile_2.0_serving/ --port 9293"
eval
$web_service_cmd
eval
$web_service_cpp_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cpp_cmd
}
"
"
${
status_log
}
"
sleep
2s
sleep
2s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_pipeline_usemkldnn_False_threads_4_batchsize_1.log"
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_pipeline_usemkldnn_False_threads_4_batchsize_1.log"
pipeline_cmd
=
"
${
python
}
ocr_cpp_client.py ppocr_det_mobile_2.0_client/ ppocr_rec_mobile_2.0_client/"
pipeline_cmd
=
"
${
python
_list
[0]
}
ocr_cpp_client.py ppocr_det_mobile_2.0_client/ ppocr_rec_mobile_2.0_client/"
eval
$pipeline_cmd
eval
$pipeline_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
sleep
2s
sleep
2s
ps ux |
grep
-E
'web_service|pipeline'
|
awk
'{print $2}'
| xargs
kill
-s
9
ps ux |
grep
-E
'web_service|pipeline'
|
awk
'{print $2}'
| xargs
kill
-s
9
else
else
web_service_cpp_cmd
=
"
${
python
}
-m paddle_serving_server.serve --model ppocr_det_mobile_2.0_serving/ ppocr_rec_mobile_2.0_serving/ --port 9293 --gpu_id=0"
web_service_cpp_cmd
=
"
${
python
_list
[0]
}
-m paddle_serving_server.serve --model ppocr_det_mobile_2.0_serving/ ppocr_rec_mobile_2.0_serving/ --port 9293 --gpu_id=0"
eval
$web_service_cmd
eval
$web_service_
cpp_
cmd
sleep
2s
sleep
2s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_pipeline_usemkldnn_False_threads_4_batchsize_1.log"
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_pipeline_usemkldnn_False_threads_4_batchsize_1.log"
pipeline_cmd
=
"
${
python
}
ocr_cpp_client.py ppocr_det_mobile_2.0_client/ ppocr_rec_mobile_2.0_client/"
pipeline_cmd
=
"
${
python
_list
[0]
}
ocr_cpp_client.py ppocr_det_mobile_2.0_client/ ppocr_rec_mobile_2.0_client/"
eval
$pipeline_cmd
eval
$pipeline_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
status_check
$last_status
"
${
pipeline_cmd
}
"
"
${
status_log
}
"
sleep
2s
sleep
2s
ps ux |
grep
-E
'web_service|pipeline'
|
awk
'{print $2}'
| xargs
kill
-s
9
ps ux |
grep
-E
'web_service|pipeline'
|
awk
'{print $2}'
| xargs
kill
-s
9
...
@@ -89,13 +92,14 @@ function func_serving(){
...
@@ -89,13 +92,14 @@ function func_serving(){
else
else
# python serving
# python serving
for
use_gpu
in
${
web_use_gpu_list
[*]
}
;
do
for
use_gpu
in
${
web_use_gpu_list
[*]
}
;
do
echo
${
ues_gpu
}
if
[
${
use_gpu
}
=
"null"
]
;
then
if
[
${
use_gpu
}
=
"null"
]
;
then
for
use_mkldnn
in
${
web_use_mkldnn_list
[*]
}
;
do
for
use_mkldnn
in
${
web_use_mkldnn_list
[*]
}
;
do
for
threads
in
${
web_cpu_threads_list
[*]
}
;
do
for
threads
in
${
web_cpu_threads_list
[*]
}
;
do
set_cpu_threads
=
$(
func_set_params
"
${
web_cpu_threads_key
}
"
"
${
threads
}
"
)
set_cpu_threads
=
$(
func_set_params
"
${
web_cpu_threads_key
}
"
"
${
threads
}
"
)
web_service_cmd
=
"
${
python
}
${
web_service_py
}
${
web_use_gpu_key
}
=
${
use_gpu
}
${
web_use_mkldnn_key
}
=
${
use_mkldnn
}
${
set_cpu_threads
}
&"
web_service_cmd
=
"
${
python
}
${
web_service_py
}
${
web_use_gpu_key
}
=
""
${
web_use_mkldnn_key
}
=
${
use_mkldnn
}
${
set_cpu_threads
}
&"
eval
$web_service_cmd
eval
$web_service_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
sleep
2s
sleep
2s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
for
pipeline
in
${
pipeline_py
[*]
}
;
do
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpu_
${
pipeline
%_client*
}
_usemkldnn_
${
use_mkldnn
}
_threads_
${
threads
}
_batchsize_1.log"
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpu_
${
pipeline
%_client*
}
_usemkldnn_
${
use_mkldnn
}
_threads_
${
threads
}
_batchsize_1.log"
...
@@ -128,6 +132,8 @@ function func_serving(){
...
@@ -128,6 +132,8 @@ function func_serving(){
set_precision
=
$(
func_set_params
"
${
web_precision_key
}
"
"
${
precision
}
"
)
set_precision
=
$(
func_set_params
"
${
web_precision_key
}
"
"
${
precision
}
"
)
web_service_cmd
=
"
${
python
}
${
web_service_py
}
${
web_use_gpu_key
}
=
${
use_gpu
}
${
set_tensorrt
}
${
set_precision
}
& "
web_service_cmd
=
"
${
python
}
${
web_service_py
}
${
web_use_gpu_key
}
=
${
use_gpu
}
${
set_tensorrt
}
${
set_precision
}
& "
eval
$web_service_cmd
eval
$web_service_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
sleep
2s
sleep
2s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
for
pipeline
in
${
pipeline_py
[*]
}
;
do
...
@@ -151,15 +157,15 @@ function func_serving(){
...
@@ -151,15 +157,15 @@ function func_serving(){
}
}
#
set cuda device
#set cuda device
GPUID
=
$2
GPUID
=
$2
if
[
${#
GPUID
}
-le
0
]
;
then
if
[
${#
GPUID
}
-le
0
]
;
then
env
=
"
"
env
=
"
export CUDA_VISIBLE_DEVICES=0
"
else
else
env
=
"export CUDA_VISIBLE_DEVICES=
${
GPUID
}
"
env
=
"export CUDA_VISIBLE_DEVICES=
${
GPUID
}
"
fi
fi
set
CUDA_VISIBLE_DEVICES
eval
$env
eval
$env
echo
$env
echo
"################### run test ###################"
echo
"################### run test ###################"
...
...
test_tipc/test_train_inference_python.sh
View file @
71d37bab
...
@@ -125,7 +125,7 @@ if [ ${MODE} = "klquant_whole_infer" ]; then
...
@@ -125,7 +125,7 @@ if [ ${MODE} = "klquant_whole_infer" ]; then
infer_value1
=
$(
func_parser_value
"
${
lines
[19]
}
"
)
infer_value1
=
$(
func_parser_value
"
${
lines
[19]
}
"
)
fi
fi
LOG_PATH
=
"./test_tipc/output"
LOG_PATH
=
"./test_tipc/output
/
${
model_name
}
"
mkdir
-p
${
LOG_PATH
}
mkdir
-p
${
LOG_PATH
}
status_log
=
"
${
LOG_PATH
}
/results_python.log"
status_log
=
"
${
LOG_PATH
}
/results_python.log"
...
...
tools/eval.py
View file @
71d37bab
...
@@ -28,7 +28,6 @@ from ppocr.modeling.architectures import build_model
...
@@ -28,7 +28,6 @@ from ppocr.modeling.architectures import build_model
from
ppocr.postprocess
import
build_post_process
from
ppocr.postprocess
import
build_post_process
from
ppocr.metrics
import
build_metric
from
ppocr.metrics
import
build_metric
from
ppocr.utils.save_load
import
load_model
from
ppocr.utils.save_load
import
load_model
from
ppocr.utils.utility
import
print_dict
import
tools.program
as
program
import
tools.program
as
program
...
...
tools/export_model.py
View file @
71d37bab
...
@@ -55,6 +55,12 @@ def export_single_model(model, arch_config, save_path, logger):
...
@@ -55,6 +55,12 @@ def export_single_model(model, arch_config, save_path, logger):
shape
=
[
None
,
3
,
48
,
160
],
dtype
=
"float32"
),
shape
=
[
None
,
3
,
48
,
160
],
dtype
=
"float32"
),
]
]
model
=
to_static
(
model
,
input_spec
=
other_shape
)
model
=
to_static
(
model
,
input_spec
=
other_shape
)
elif
arch_config
[
"algorithm"
]
==
"PREN"
:
other_shape
=
[
paddle
.
static
.
InputSpec
(
shape
=
[
None
,
3
,
64
,
512
],
dtype
=
"float32"
),
]
model
=
to_static
(
model
,
input_spec
=
other_shape
)
else
:
else
:
infer_shape
=
[
3
,
-
1
,
-
1
]
infer_shape
=
[
3
,
-
1
,
-
1
]
if
arch_config
[
"model_type"
]
==
"rec"
:
if
arch_config
[
"model_type"
]
==
"rec"
:
...
...
tools/infer/predict_cls.py
View file @
71d37bab
...
@@ -16,7 +16,7 @@ import sys
...
@@ -16,7 +16,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer/predict_det.py
View file @
71d37bab
...
@@ -16,7 +16,7 @@ import sys
...
@@ -16,7 +16,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
@@ -98,6 +98,18 @@ class TextDetector(object):
...
@@ -98,6 +98,18 @@ class TextDetector(object):
postprocess_params
[
"box_type"
]
=
args
.
det_pse_box_type
postprocess_params
[
"box_type"
]
=
args
.
det_pse_box_type
postprocess_params
[
"scale"
]
=
args
.
det_pse_scale
postprocess_params
[
"scale"
]
=
args
.
det_pse_scale
self
.
det_pse_box_type
=
args
.
det_pse_box_type
self
.
det_pse_box_type
=
args
.
det_pse_box_type
elif
self
.
det_algorithm
==
"FCE"
:
pre_process_list
[
0
]
=
{
'DetResizeForTest'
:
{
'rescale_img'
:
[
1080
,
736
]
}
}
postprocess_params
[
'name'
]
=
'FCEPostProcess'
postprocess_params
[
"scales"
]
=
args
.
scales
postprocess_params
[
"alpha"
]
=
args
.
alpha
postprocess_params
[
"beta"
]
=
args
.
beta
postprocess_params
[
"fourier_degree"
]
=
args
.
fourier_degree
postprocess_params
[
"box_type"
]
=
args
.
det_fce_box_type
else
:
else
:
logger
.
info
(
"unknown det_algorithm:{}"
.
format
(
self
.
det_algorithm
))
logger
.
info
(
"unknown det_algorithm:{}"
.
format
(
self
.
det_algorithm
))
sys
.
exit
(
0
)
sys
.
exit
(
0
)
...
@@ -234,15 +246,18 @@ class TextDetector(object):
...
@@ -234,15 +246,18 @@ class TextDetector(object):
preds
[
'f_tvo'
]
=
outputs
[
3
]
preds
[
'f_tvo'
]
=
outputs
[
3
]
elif
self
.
det_algorithm
in
[
'DB'
,
'PSE'
]:
elif
self
.
det_algorithm
in
[
'DB'
,
'PSE'
]:
preds
[
'maps'
]
=
outputs
[
0
]
preds
[
'maps'
]
=
outputs
[
0
]
elif
self
.
det_algorithm
==
'FCE'
:
for
i
,
output
in
enumerate
(
outputs
):
preds
[
'level_{}'
.
format
(
i
)]
=
output
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
#self.predictor.try_shrink_memory()
#self.predictor.try_shrink_memory()
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
dt_boxes
=
post_result
[
0
][
'points'
]
dt_boxes
=
post_result
[
0
][
'points'
]
if
(
self
.
det_algorithm
==
"SAST"
and
if
(
self
.
det_algorithm
==
"SAST"
and
self
.
det_sast_polygon
)
or
(
self
.
det_sast_polygon
)
or
(
self
.
det_algorithm
==
"PSE"
and
self
.
det_algorithm
in
[
"PSE"
,
"FCE"
]
and
self
.
det_pse_
box_type
==
'poly'
):
self
.
postprocess_op
.
box_type
==
'poly'
):
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
dt_boxes
,
ori_im
.
shape
)
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
dt_boxes
,
ori_im
.
shape
)
else
:
else
:
dt_boxes
=
self
.
filter_tag_det_res
(
dt_boxes
,
ori_im
.
shape
)
dt_boxes
=
self
.
filter_tag_det_res
(
dt_boxes
,
ori_im
.
shape
)
...
...
tools/infer/predict_e2e.py
View file @
71d37bab
...
@@ -16,7 +16,7 @@ import sys
...
@@ -16,7 +16,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer/predict_rec.py
View file @
71d37bab
...
@@ -16,7 +16,7 @@ import sys
...
@@ -16,7 +16,7 @@ import sys
from
PIL
import
Image
from
PIL
import
Image
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer/predict_system.py
View file @
71d37bab
...
@@ -17,7 +17,7 @@ import subprocess
...
@@ -17,7 +17,7 @@ import subprocess
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer/utility.py
View file @
71d37bab
...
@@ -68,9 +68,16 @@ def init_args():
...
@@ -68,9 +68,16 @@ def init_args():
parser
.
add_argument
(
"--det_pse_thresh"
,
type
=
float
,
default
=
0
)
parser
.
add_argument
(
"--det_pse_thresh"
,
type
=
float
,
default
=
0
)
parser
.
add_argument
(
"--det_pse_box_thresh"
,
type
=
float
,
default
=
0.85
)
parser
.
add_argument
(
"--det_pse_box_thresh"
,
type
=
float
,
default
=
0.85
)
parser
.
add_argument
(
"--det_pse_min_area"
,
type
=
float
,
default
=
16
)
parser
.
add_argument
(
"--det_pse_min_area"
,
type
=
float
,
default
=
16
)
parser
.
add_argument
(
"--det_pse_box_type"
,
type
=
str
,
default
=
'
box
'
)
parser
.
add_argument
(
"--det_pse_box_type"
,
type
=
str
,
default
=
'
quad
'
)
parser
.
add_argument
(
"--det_pse_scale"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"--det_pse_scale"
,
type
=
int
,
default
=
1
)
# FCE parmas
parser
.
add_argument
(
"--scales"
,
type
=
list
,
default
=
[
8
,
16
,
32
])
parser
.
add_argument
(
"--alpha"
,
type
=
float
,
default
=
1.0
)
parser
.
add_argument
(
"--beta"
,
type
=
float
,
default
=
1.0
)
parser
.
add_argument
(
"--fourier_degree"
,
type
=
int
,
default
=
5
)
parser
.
add_argument
(
"--det_fce_box_type"
,
type
=
str
,
default
=
'poly'
)
# params for text recognizer
# params for text recognizer
parser
.
add_argument
(
"--rec_algorithm"
,
type
=
str
,
default
=
'CRNN'
)
parser
.
add_argument
(
"--rec_algorithm"
,
type
=
str
,
default
=
'CRNN'
)
parser
.
add_argument
(
"--rec_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--rec_model_dir"
,
type
=
str
)
...
...
tools/infer_cls.py
View file @
71d37bab
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_det.py
View file @
71d37bab
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_e2e.py
View file @
71d37bab
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_kie.py
View file @
71d37bab
...
@@ -24,7 +24,7 @@ import sys
...
@@ -24,7 +24,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_rec.py
View file @
71d37bab
...
@@ -24,7 +24,7 @@ import json
...
@@ -24,7 +24,7 @@ import json
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_table.py
View file @
71d37bab
...
@@ -24,7 +24,7 @@ import json
...
@@ -24,7 +24,7 @@ import json
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
...
...
tools/infer_vqa_token_ser.py
View file @
71d37bab
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
...
...
tools/infer_vqa_token_ser_re.py
View file @
71d37bab
...
@@ -23,7 +23,7 @@ import sys
...
@@ -23,7 +23,7 @@ import sys
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
__dir__
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
...
...
tools/program.py
View file @
71d37bab
...
@@ -541,7 +541,7 @@ def preprocess(is_train=False):
...
@@ -541,7 +541,7 @@ def preprocess(is_train=False):
assert
alg
in
[
assert
alg
in
[
'EAST'
,
'DB'
,
'SAST'
,
'Rosetta'
,
'CRNN'
,
'STARNet'
,
'RARE'
,
'SRN'
,
'EAST'
,
'DB'
,
'SAST'
,
'Rosetta'
,
'CRNN'
,
'STARNet'
,
'RARE'
,
'SRN'
,
'CLS'
,
'PGNet'
,
'Distillation'
,
'NRTR'
,
'TableAttn'
,
'SAR'
,
'PSE'
,
'CLS'
,
'PGNet'
,
'Distillation'
,
'NRTR'
,
'TableAttn'
,
'SAR'
,
'PSE'
,
'SEED'
,
'SDMGR'
,
'LayoutXLM'
,
'LayoutLM'
'SEED'
,
'SDMGR'
,
'LayoutXLM'
,
'LayoutLM'
,
'PREN'
,
'FCE'
]
]
device
=
'cpu'
device
=
'cpu'
...
...
Prev
1
…
4
5
6
7
8
9
Next
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