Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
16a657e5
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
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看板
未验证
提交
16a657e5
编写于
8月 09, 2022
作者:
Z
zhiboniu
提交者:
GitHub
8月 09, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
car licenseplate skipframe&time counter vote (#6609)
* car licenseplate skipframe&time counter vote * incase of no track
上级
d1892fff
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
11 deletion
+32
-11
deploy/pipeline/datacollector.py
deploy/pipeline/datacollector.py
+11
-1
deploy/pipeline/pipeline.py
deploy/pipeline/pipeline.py
+21
-10
未找到文件。
deploy/pipeline/datacollector.py
浏览文件 @
16a657e5
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
import
os
import
os
import
copy
import
copy
from
collections
import
Counter
class
Result
(
object
):
class
Result
(
object
):
...
@@ -113,9 +114,18 @@ class DataCollector(object):
...
@@ -113,9 +114,18 @@ class DataCollector(object):
idx
])
idx
])
self
.
collector
[
ids
][
"qualities"
].
append
(
reid_res
[
'qualities'
][
self
.
collector
[
ids
][
"qualities"
].
append
(
reid_res
[
'qualities'
][
idx
])
idx
])
if
vehicleplate_res
:
if
vehicleplate_res
and
vehicleplate_res
[
'plate'
][
idx
]
!=
""
:
self
.
collector
[
ids
][
"vehicleplate"
].
append
(
vehicleplate_res
[
self
.
collector
[
ids
][
"vehicleplate"
].
append
(
vehicleplate_res
[
'plate'
][
idx
])
'plate'
][
idx
])
def
get_res
(
self
):
def
get_res
(
self
):
return
self
.
collector
return
self
.
collector
def
get_carlp
(
self
,
trackid
):
lps
=
self
.
collector
[
trackid
][
"vehicleplate"
]
counter
=
Counter
(
lps
)
carlp
=
counter
.
most_common
()
if
len
(
carlp
)
>
0
:
return
carlp
[
0
][
0
]
else
:
return
None
deploy/pipeline/pipeline.py
浏览文件 @
16a657e5
...
@@ -781,7 +781,7 @@ class PipePredictor(object):
...
@@ -781,7 +781,7 @@ class PipePredictor(object):
crop_input
,
new_bboxes
,
ori_bboxes
=
crop_image_with_mot
(
crop_input
,
new_bboxes
,
ori_bboxes
=
crop_image_with_mot
(
frame_rgb
,
mot_res
)
frame_rgb
,
mot_res
)
if
self
.
with_vehicleplate
:
if
self
.
with_vehicleplate
and
frame_id
%
10
==
0
:
if
frame_id
>
self
.
warmup_frame
:
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
module_time
[
'vehicleplate'
].
start
()
self
.
pipe_timer
.
module_time
[
'vehicleplate'
].
start
()
plate_input
,
_
,
_
=
crop_image_with_mot
(
plate_input
,
_
,
_
=
crop_image_with_mot
(
...
@@ -791,6 +791,8 @@ class PipePredictor(object):
...
@@ -791,6 +791,8 @@ class PipePredictor(object):
if
frame_id
>
self
.
warmup_frame
:
if
frame_id
>
self
.
warmup_frame
:
self
.
pipe_timer
.
module_time
[
'vehicleplate'
].
end
()
self
.
pipe_timer
.
module_time
[
'vehicleplate'
].
end
()
self
.
pipeline_res
.
update
(
platelicense
,
'vehicleplate'
)
self
.
pipeline_res
.
update
(
platelicense
,
'vehicleplate'
)
else
:
self
.
pipeline_res
.
clear
(
'vehicleplate'
)
if
self
.
with_human_attr
:
if
self
.
with_human_attr
:
if
frame_id
>
self
.
warmup_frame
:
if
frame_id
>
self
.
warmup_frame
:
...
@@ -935,9 +937,9 @@ class PipePredictor(object):
...
@@ -935,9 +937,9 @@ class PipePredictor(object):
if
self
.
cfg
[
'visual'
]:
if
self
.
cfg
[
'visual'
]:
_
,
_
,
fps
=
self
.
pipe_timer
.
get_total_time
()
_
,
_
,
fps
=
self
.
pipe_timer
.
get_total_time
()
im
=
self
.
visualize_video
(
frame
,
self
.
pipeline_res
,
frame_id
,
im
=
self
.
visualize_video
(
fps
,
entrance
,
record
s
,
frame
,
self
.
pipeline_res
,
self
.
collector
,
frame_id
,
fp
s
,
center_traj
)
# visualize
entrance
,
records
,
center_traj
)
# visualize
writer
.
write
(
im
)
writer
.
write
(
im
)
if
self
.
file_name
is
None
:
# use camera_id
if
self
.
file_name
is
None
:
# use camera_id
cv2
.
imshow
(
'Paddle-Pipeline'
,
im
)
cv2
.
imshow
(
'Paddle-Pipeline'
,
im
)
...
@@ -950,6 +952,7 @@ class PipePredictor(object):
...
@@ -950,6 +952,7 @@ class PipePredictor(object):
def
visualize_video
(
self
,
def
visualize_video
(
self
,
image
,
image
,
result
,
result
,
collector
,
frame_id
,
frame_id
,
fps
,
fps
,
entrance
=
None
,
entrance
=
None
,
...
@@ -1006,12 +1009,20 @@ class PipePredictor(object):
...
@@ -1006,12 +1009,20 @@ class PipePredictor(object):
image
=
visualize_attr
(
image
,
vehicle_attr_res
,
boxes
)
image
=
visualize_attr
(
image
,
vehicle_attr_res
,
boxes
)
image
=
np
.
array
(
image
)
image
=
np
.
array
(
image
)
vehicleplate_res
=
result
.
get
(
'vehicleplate'
)
if
mot_res
is
not
None
:
if
vehicleplate_res
:
vehicleplate
=
False
boxes
=
mot_res
[
'boxes'
][:,
1
:]
plates
=
[]
image
=
visualize_vehicleplate
(
image
,
vehicleplate_res
[
'plate'
],
for
trackid
in
mot_res
[
'boxes'
][:,
0
]:
boxes
)
plate
=
collector
.
get_carlp
(
trackid
)
image
=
np
.
array
(
image
)
if
plate
!=
None
:
vehicleplate
=
True
plates
.
append
(
plate
)
else
:
plates
.
append
(
""
)
if
vehicleplate
:
boxes
=
mot_res
[
'boxes'
][:,
1
:]
image
=
visualize_vehicleplate
(
image
,
plates
,
boxes
)
image
=
np
.
array
(
image
)
kpt_res
=
result
.
get
(
'kpt'
)
kpt_res
=
result
.
get
(
'kpt'
)
if
kpt_res
is
not
None
:
if
kpt_res
is
not
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录