Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
4e517475
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4e517475
编写于
11月 17, 2021
作者:
W
wangguanzhong
提交者:
GitHub
11月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support draw traj in mct (#4604)
上级
d6dff40e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
20 deletion
+39
-20
deploy/pptracking/python/mot_jde_infer.py
deploy/pptracking/python/mot_jde_infer.py
+1
-1
deploy/pptracking/python/utils.py
deploy/pptracking/python/utils.py
+1
-1
deploy/pptracking/python/visualize.py
deploy/pptracking/python/visualize.py
+37
-18
未找到文件。
deploy/pptracking/python/mot_jde_infer.py
浏览文件 @
4e517475
...
...
@@ -224,7 +224,7 @@ def predict_video(detector, camera_id):
entrance
=
None
records
=
None
if
FLAGS
.
draw_center_traj
:
center_traj
=
{}
center_traj
=
[{}
for
i
in
range
(
num_classes
)]
if
num_classes
==
1
:
id_set
=
set
()
...
...
deploy/pptracking/python/utils.py
浏览文件 @
4e517475
...
...
@@ -129,7 +129,7 @@ def argsparser():
parser
.
add_argument
(
"--secs_interval"
,
type
=
int
,
default
=
10
,
default
=
2
,
help
=
"The seconds interval to count after tracking"
)
parser
.
add_argument
(
"--draw_center_traj"
,
...
...
deploy/pptracking/python/visualize.py
浏览文件 @
4e517475
...
...
@@ -213,6 +213,33 @@ def plot_tracking_dict(image,
radius
=
max
(
5
,
int
(
im_w
/
140.
))
if
num_classes
==
1
:
start
=
records
[
-
1
].
find
(
'Total'
)
end
=
records
[
-
1
].
find
(
'In'
)
cv2
.
putText
(
im
,
records
[
-
1
][
start
:
end
-
2
],
(
0
,
int
(
40
*
text_scale
)),
cv2
.
FONT_HERSHEY_PLAIN
,
text_scale
,
(
0
,
0
,
255
),
thickness
=
2
)
if
num_classes
==
1
and
do_entrance_counting
:
entrance_line
=
tuple
(
map
(
int
,
entrance
))
cv2
.
rectangle
(
im
,
entrance_line
[
0
:
2
],
entrance_line
[
2
:
4
],
color
=
(
0
,
255
,
255
),
thickness
=
line_thickness
)
# find start location for entrance counting data
start
=
records
[
-
1
].
find
(
'In'
)
cv2
.
putText
(
im
,
records
[
-
1
][
start
:
-
1
],
(
0
,
int
(
60
*
text_scale
)),
cv2
.
FONT_HERSHEY_PLAIN
,
text_scale
,
(
0
,
0
,
255
),
thickness
=
2
)
for
cls_id
in
range
(
num_classes
):
tlwhs
=
tlwhs_dict
[
cls_id
]
obj_ids
=
obj_ids_dict
[
cls_id
]
...
...
@@ -233,9 +260,9 @@ def plot_tracking_dict(image,
obj_id
=
int
(
obj_ids
[
i
])
if
center_traj
is
not
None
:
record_id
.
add
(
obj_id
)
if
obj_id
not
in
center_traj
:
center_traj
[
obj_id
]
=
deque
(
maxlen
=
30
)
center_traj
[
obj_id
].
append
(
center
)
if
obj_id
not
in
center_traj
[
cls_id
]
:
center_traj
[
cls_id
][
obj_id
]
=
deque
(
maxlen
=
30
)
center_traj
[
cls_id
][
obj_id
].
append
(
center
)
id_text
=
'{}'
.
format
(
int
(
obj_id
))
if
ids2names
!=
[]:
...
...
@@ -266,19 +293,11 @@ def plot_tracking_dict(image,
cv2
.
FONT_HERSHEY_PLAIN
,
text_scale
,
(
0
,
255
,
255
),
thickness
=
text_thickness
)
if
num_classes
==
1
and
do_entrance_counting
:
entrance_line
=
tuple
(
map
(
int
,
entrance
))
cv2
.
rectangle
(
im
,
entrance_line
[
0
:
2
],
entrance_line
[
2
:
4
],
color
=
(
0
,
255
,
255
),
thickness
=
line_thickness
)
if
center_traj
is
not
None
:
for
i
in
center_traj
.
keys
():
if
i
not
in
record_id
:
continue
for
point
in
center_traj
[
i
]:
cv2
.
circle
(
im
,
point
,
3
,
(
0
,
0
,
255
),
-
1
)
if
center_traj
is
not
None
:
for
traj
in
center_traj
:
for
i
in
traj
.
keys
():
if
i
not
in
record_id
:
continue
for
point
in
traj
[
i
]:
cv2
.
circle
(
im
,
point
,
3
,
(
0
,
0
,
255
),
-
1
)
return
im
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录