Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
f2a883ed
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f2a883ed
编写于
6月 20, 2022
作者:
Z
zhiboniu
提交者:
zhiboniu
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ppvehicle plate license
上级
04b3f389
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
47 deletion
+52
-47
deploy/pphuman/config/infer_cfg_pphuman.yml
deploy/pphuman/config/infer_cfg_pphuman.yml
+1
-1
deploy/pphuman/config/infer_cfg_ppvehicle.yml
deploy/pphuman/config/infer_cfg_ppvehicle.yml
+6
-37
deploy/pphuman/pipeline.py
deploy/pphuman/pipeline.py
+9
-3
deploy/pphuman/ppvehicle/vehicle_plate.py
deploy/pphuman/ppvehicle/vehicle_plate.py
+1
-6
deploy/python/visualize.py
deploy/python/visualize.py
+35
-0
未找到文件。
deploy/pphuman/config/infer_cfg_pphuman.yml
浏览文件 @
f2a883ed
...
...
@@ -9,7 +9,7 @@ DET:
batch_size
:
1
MOT
:
model_dir
:
pipeline_model//mot_ppyoloe_s_36e_ppvehicl
e/
model_dir
:
output_inference/mot_ppyoloe_l_36e_pipelin
e/
tracker_config
:
deploy/pphuman/config/tracker_config.yml
batch_size
:
1
basemode
:
"
idbased"
...
...
deploy/pphuman/config/infer_cfg_ppvehicle.yml
浏览文件 @
f2a883ed
crop_thresh
:
0.5
attr_thresh
:
0.5
kpt_thresh
:
0.2
visual
:
Fals
e
visual
:
Tru
e
warmup_frame
:
50
DET
:
...
...
@@ -9,7 +9,7 @@ DET:
batch_size
:
1
MOT
:
model_dir
:
pipeline_model/
/mot_ppyoloe_s_36e_ppvehicle/
model_dir
:
output_inference
/mot_ppyoloe_s_36e_ppvehicle/
tracker_config
:
deploy/pphuman/config/tracker_config.yml
batch_size
:
1
basemode
:
"
idbased"
...
...
@@ -17,14 +17,14 @@ MOT:
VEHICLE_PLATE
:
det_algorithm
:
"
DB"
det_model_dir
:
"
output/ch_PP-OCRv3_det_infer/"
det_model_dir
:
output_inference/ch_PP-OCRv3_det_infer/
det_limit_side_len
:
480
det_limit_type
:
"
max"
rec_algorithm
:
"
SVTR_LCNet"
rec_model_dir
:
"
output/ch_PP-OCRv3_rec_infer/"
rec_model_dir
:
output_inference/ch_PP-OCRv3_rec_infer/
rec_image_shape
:
[
3
,
48
,
320
]
rec_batch_num
:
6
word_dict_path
:
"
deploy/pphuman/ppvehicle/rec_word_dict.txt"
word_dict_path
:
deploy/pphuman/ppvehicle/rec_word_dict.txt
basemode
:
"
idbased"
enable
:
True
...
...
@@ -34,39 +34,8 @@ ATTR:
basemode
:
"
idbased"
enable
:
False
VIDEO_ACTION
:
model_dir
:
output_inference/ppTSM
batch_size
:
1
frame_len
:
8
sample_freq
:
7
short_size
:
340
target_size
:
320
basemode
:
"
videobased"
enable
:
False
SKELETON_ACTION
:
model_dir
:
output_inference/STGCN
batch_size
:
1
max_frames
:
50
display_frames
:
80
coord_size
:
[
384
,
512
]
basemode
:
"
skeletonbased"
enable
:
False
ID_BASED_DETACTION
:
model_dir
:
output_inference/detector
batch_size
:
1
basemode
:
"
idbased"
enable
:
False
ID_BASED_CLSACTION
:
model_dir
:
output_inference/classification
batch_size
:
1
basemode
:
"
idbased"
enable
:
False
REID
:
model_dir
:
output_inference/reid_model/
model_dir
:
output_inference/
vehicle_
reid_model/
batch_size
:
16
basemode
:
"
idbased"
enable
:
False
deploy/pphuman/pipeline.py
浏览文件 @
f2a883ed
...
...
@@ -45,7 +45,7 @@ from python.action_utils import KeyPointBuff, ActionVisualHelper
from
pipe_utils
import
argsparser
,
print_arguments
,
merge_cfg
,
PipeTimer
from
pipe_utils
import
get_test_images
,
crop_image_with_det
,
crop_image_with_mot
,
parse_mot_res
,
parse_mot_keypoint
from
python.preprocess
import
decode_image
,
ShortSizeScale
from
python.visualize
import
visualize_box_mask
,
visualize_attr
,
visualize_pose
,
visualize_action
from
python.visualize
import
visualize_box_mask
,
visualize_attr
,
visualize_pose
,
visualize_action
,
visualize_vehicleplate
from
pptracking.python.mot_sde_infer
import
SDE_Detector
from
pptracking.python.mot.visualize
import
plot_tracking_dict
...
...
@@ -618,7 +618,7 @@ class PipePredictor(object):
center_traj
)
# visualize
writer
.
write
(
im
)
if
self
.
file_name
is
None
:
# use camera_id
cv2
.
imshow
(
'PPHuman'
,
im
)
cv2
.
imshow
(
'PPHuman
&&PPVehicle
'
,
im
)
if
cv2
.
waitKey
(
1
)
&
0xFF
==
ord
(
'q'
):
break
continue
...
...
@@ -630,7 +630,6 @@ class PipePredictor(object):
if
self
.
with_vehicleplate
:
platelicense
=
self
.
vehicleplate_detector
.
get_platelicense
(
crop_input
)
print
(
"find plate license:{}"
.
format
(
platelicense
))
self
.
pipeline_res
.
update
(
platelicense
,
'vehicleplate'
)
if
self
.
with_attr
:
...
...
@@ -828,6 +827,13 @@ class PipePredictor(object):
image
=
visualize_attr
(
image
,
attr_res
,
boxes
)
image
=
np
.
array
(
image
)
vehicleplate_res
=
result
.
get
(
'vehicleplate'
)
if
vehicleplate_res
:
boxes
=
mot_res
[
'boxes'
][:,
1
:]
image
=
visualize_vehicleplate
(
image
,
vehicleplate_res
[
'plate'
],
boxes
)
image
=
np
.
array
(
image
)
kpt_res
=
result
.
get
(
'kpt'
)
if
kpt_res
is
not
None
:
image
=
visualize_pose
(
...
...
deploy/pphuman/ppvehicle/vehicle_plate.py
浏览文件 @
f2a883ed
...
...
@@ -499,10 +499,7 @@ class PlateRecognizer(object):
plate_images
=
get_rotate_crop_image
(
image_list
[
idx
],
box
)
plate_texts
=
self
.
textrecognizer
.
predict_text
([
plate_images
])
plate_pcar_list
.
append
(
plate_texts
)
# print("plate text:{}".format(plate_texts))
plate_text_list
.
append
(
plate_pcar_list
)
# newimg = draw_boxes(image_list[idx], boxes_pcar)
# cv2.imwrite("vehicle_plate.jpg", newimg)
return
self
.
check_plate
(
plate_text_list
)
def
check_plate
(
self
,
text_list
):
...
...
@@ -513,11 +510,10 @@ class PlateRecognizer(object):
]
plate_all
=
{
"plate"
:
[]}
for
text_pcar
in
text_list
:
platelicense
=
None
platelicense
=
""
for
text_info
in
text_pcar
:
text
=
text_info
[
0
][
0
][
0
]
if
len
(
text
)
>
2
and
text
[
0
]
in
simcode
and
len
(
text
)
<
10
:
# print("text:{} length:{}".format(text, len(text)))
platelicense
=
text
plate_all
[
"plate"
].
append
(
platelicense
)
return
plate_all
...
...
@@ -529,7 +525,6 @@ def main():
img_list
=
get_test_images
(
FLAGS
.
image_dir
,
FLAGS
.
image_file
)
for
img
in
img_list
:
image
=
cv2
.
imread
(
img
)
# image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
results
=
detector
.
get_platelicense
([
image
])
...
...
deploy/python/visualize.py
浏览文件 @
f2a883ed
...
...
@@ -403,3 +403,38 @@ def visualize_action(im,
thickness
=
text_thickness
)
return
im
def
visualize_vehicleplate
(
im
,
results
,
boxes
=
None
):
if
isinstance
(
im
,
str
):
im
=
Image
.
open
(
im
)
im
=
np
.
ascontiguousarray
(
np
.
copy
(
im
))
im
=
cv2
.
cvtColor
(
im
,
cv2
.
COLOR_RGB2BGR
)
else
:
im
=
np
.
ascontiguousarray
(
np
.
copy
(
im
))
im_h
,
im_w
=
im
.
shape
[:
2
]
text_scale
=
max
(
0.5
,
im
.
shape
[
0
]
/
3000.
)
text_thickness
=
1
line_inter
=
im
.
shape
[
0
]
/
40.
for
i
,
res
in
enumerate
(
results
):
if
boxes
is
None
:
text_w
=
3
text_h
=
1
else
:
box
=
boxes
[
i
]
text
=
res
if
text
==
""
:
continue
text_w
=
int
(
box
[
2
])
text_h
=
int
(
box
[
5
])
text_loc
=
(
text_w
,
text_h
)
cv2
.
putText
(
im
,
text
,
text_loc
,
cv2
.
FONT_ITALIC
,
text_scale
,
(
0
,
255
,
255
),
thickness
=
text_thickness
)
return
im
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录