Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
73ef70f0
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看板
未验证
提交
73ef70f0
编写于
8月 29, 2022
作者:
F
Feng Ni
提交者:
GitHub
8月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cherry-pick] fix illegal parking doc (#6764)
上级
3a233e83
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
73 addition
and
23 deletion
+73
-23
deploy/pipeline/docs/tutorials/pphuman_mot.md
deploy/pipeline/docs/tutorials/pphuman_mot.md
+4
-1
deploy/pipeline/docs/tutorials/ppvehicle_illegal_parking.md
deploy/pipeline/docs/tutorials/ppvehicle_illegal_parking.md
+10
-0
deploy/pipeline/docs/tutorials/ppvehicle_mot.md
deploy/pipeline/docs/tutorials/ppvehicle_mot.md
+4
-1
deploy/pipeline/pipeline.py
deploy/pipeline/pipeline.py
+14
-4
deploy/pptracking/python/mot/utils.py
deploy/pptracking/python/mot/utils.py
+11
-9
deploy/pptracking/python/mot_jde_infer.py
deploy/pptracking/python/mot_jde_infer.py
+15
-4
deploy/pptracking/python/mot_sde_infer.py
deploy/pptracking/python/mot_sde_infer.py
+15
-4
未找到文件。
deploy/pipeline/docs/tutorials/pphuman_mot.md
浏览文件 @
73ef70f0
...
...
@@ -76,13 +76,16 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_pph
--
region_polygon
200
200
400
200
300
400
100
400
```
**注意:**
-
区域闯入的测试视频必须是静止摄像头拍摄的,镜头不能抖动或移动。
-
`--do_break_in_counting`
表示是否进行区域出入后计数,不设置即默认为False。
-
`--region_type`
表示流量计数的区域,当设置
`--do_break_in_counting`
时仅可选择
`custom`
,默认是
`custom`
,表示以用户自定义区域为出入口,同一物体框的下边界中点坐标在相邻两秒内从区域外到区域内,即完成计数加一。
-
`--region_polygon`
表示用户自定义区域的多边形的点坐标序列,每两个为一对点坐标(x,y)
,按顺时针顺序连成一个封闭区域,至少需要3对点也即6个整数,默认值是
`[]`
,需要用户自行设置点坐标
。用户可以运行
[
此段代码
](
../../tools/get_video_info.py
)
获取所测视频的分辨率帧数,以及可以自定义画出自己想要的多边形区域的可视化并自己调整。
-
`--region_polygon`
表示用户自定义区域的多边形的点坐标序列,每两个为一对点坐标(x,y)
,
**按顺时针顺序**
连成一个
**封闭区域**
,至少需要3对点也即6个整数,默认值是
`[]`
,需要用户自行设置点坐标,如是四边形区域,坐标顺序是
`左上、右上、右下、左下`
。用户可以运行
[
此段代码
](
../../tools/get_video_info.py
)
获取所测视频的分辨率帧数,以及可以自定义画出自己想要的多边形区域的可视化并自己调整。
自定义多边形区域的可视化代码运行如下:
```
python
python
get_video_info
.
py
--
video_file
=
demo
.
mp4
--
region_polygon
200
200
400
200
300
400
100
400
```
快速画出想要的区域的小技巧:先任意取点得到图片,用画图工具打开,鼠标放到想要的区域点上会显示出坐标,记录下来并取整,作为这段可视化代码的region_polygon参数,并再次运行可视化,微调点坐标参数直至满意。
测试效果如下:
...
...
deploy/pipeline/docs/tutorials/ppvehicle_illegal_parking.md
浏览文件 @
73ef70f0
...
...
@@ -55,6 +55,16 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/examples/infe
-
region_type:非法停车区域类型,custom表示自定义;
-
region_polygon:自定义非法停车多边形,至少为3个点。
**注意:**
-
违法停车的测试视频必须是静止摄像头拍摄的,镜头不能抖动或移动。
-
`--region_polygon`
表示用户自定义区域的多边形的点坐标序列,每两个为一对点坐标(x,y),
**按顺时针顺序**
连成一个
**封闭区域**
,至少需要3对点也即6个整数,默认值是
`[]`
,需要用户自行设置点坐标,如是四边形区域,坐标顺序是
`左上、右上、右下、左下`
。用户可以运行
[
此段代码
](
../../tools/get_video_info.py
)
获取所测视频的分辨率帧数,以及可以自定义画出自己想要的多边形区域的可视化并自己调整。
自定义多边形区域的可视化代码运行如下:
```
python
python
get_video_info
.
py
--
video_file
=
demo
.
mp4
--
region_polygon
200
200
400
200
300
400
100
400
```
快速画出想要的区域的小技巧:先任意取点得到图片,用画图工具打开,鼠标放到想要的区域点上会显示出坐标,记录下来并取整,作为这段可视化代码的region_polygon参数,并再次运行可视化,微调点坐标参数直至满意。
3.
若修改模型路径,有以下两种方式:
- 方法一:```./deploy/pipeline/config/examples/infer_cfg_illegal_parking.yml```下可以配置不同模型路径;
...
...
deploy/pipeline/docs/tutorials/ppvehicle_mot.md
浏览文件 @
73ef70f0
...
...
@@ -86,13 +86,16 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv
--
region_polygon
200
200
400
200
300
400
100
400
```
**注意:**
-
区域闯入的测试视频必须是静止摄像头拍摄的,镜头不能抖动或移动。
-
`--do_break_in_counting`
表示是否进行区域出入后计数,不设置即默认为False。
-
`--region_type`
表示流量计数的区域,当设置
`--do_break_in_counting`
时仅可选择
`custom`
,默认是
`custom`
,表示以用户自定义区域为出入口,同一物体框的下边界中点坐标在相邻两秒内从区域外到区域内,即完成计数加一。
-
`--region_polygon`
表示用户自定义区域的多边形的点坐标序列,每两个为一对点坐标(x,y)
,按顺时针顺序连成一个封闭区域,至少需要3对点也即6个整数,默认值是
`[]`
,需要用户自行设置点坐标
。用户可以运行
[
此段代码
](
../../tools/get_video_info.py
)
获取所测视频的分辨率帧数,以及可以自定义画出自己想要的多边形区域的可视化并自己调整。
-
`--region_polygon`
表示用户自定义区域的多边形的点坐标序列,每两个为一对点坐标(x,y)
,
**按顺时针顺序**
连成一个
**封闭区域**
,至少需要3对点也即6个整数,默认值是
`[]`
,需要用户自行设置点坐标,如是四边形区域,坐标顺序是
`左上、右上、右下、左下`
。用户可以运行
[
此段代码
](
../../tools/get_video_info.py
)
获取所测视频的分辨率帧数,以及可以自定义画出自己想要的多边形区域的可视化并自己调整。
自定义多边形区域的可视化代码运行如下:
```
python
python
get_video_info
.
py
--
video_file
=
demo
.
mp4
--
region_polygon
200
200
400
200
300
400
100
400
```
快速画出想要的区域的小技巧:先任意取点得到图片,用画图工具打开,鼠标放到想要的区域点上会显示出坐标,记录下来并取整,作为这段可视化代码的region_polygon参数,并再次运行可视化,微调点坐标参数直至满意。
【效果展示】
...
...
deploy/pipeline/pipeline.py
浏览文件 @
73ef70f0
...
...
@@ -626,10 +626,20 @@ class PipePredictor(object):
mot_result
=
(
frame_id
+
1
,
boxes
[
0
],
scores
[
0
],
ids
[
0
])
# single class
statistic
=
flow_statistic
(
mot_result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
)
mot_result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
,
ids2names
=
self
.
mot_predictor
.
pred_config
.
labels
)
records
=
statistic
[
'records'
]
if
self
.
illegal_parking_time
!=
-
1
:
...
...
deploy/pptracking/python/mot/utils.py
浏览文件 @
73ef70f0
...
...
@@ -224,7 +224,7 @@ def flow_statistic(result,
prev_center
,
records
,
data_type
=
'mot'
,
num_classes
=
1
):
ids2names
=
[
'pedestrian'
]
):
# Count in/out number:
# Note that 'region_type' should be one of ['horizontal', 'vertical', 'custom'],
# 'horizontal' and 'vertical' means entrance is the center line as the entrance when do_entrance_counting,
...
...
@@ -282,25 +282,27 @@ def flow_statistic(result,
frame_id
-=
1
x1
,
y1
,
w
,
h
=
tlwh
center_x
=
min
(
x1
+
w
/
2.
,
im_w
-
1
)
center_down_y
=
min
(
y1
+
h
,
im_h
-
1
)
if
ids2names
[
0
]
==
'pedestrian'
:
center_y
=
min
(
y1
+
h
,
im_h
-
1
)
else
:
center_y
=
min
(
y1
+
h
/
2
,
im_h
-
1
)
# counting objects in region of the first frame
if
frame_id
==
1
:
if
in_quadrangle
([
center_x
,
center_down_y
],
entrance
,
im_h
,
im_w
):
if
in_quadrangle
([
center_x
,
center_y
],
entrance
,
im_h
,
im_w
):
in_id_list
.
append
(
-
1
)
else
:
prev_center
[
track_id
]
=
[
center_x
,
center_
down_
y
]
prev_center
[
track_id
]
=
[
center_x
,
center_y
]
else
:
if
track_id
in
prev_center
:
if
not
in_quadrangle
(
prev_center
[
track_id
],
entrance
,
im_h
,
im_w
)
and
in_quadrangle
(
[
center_x
,
center_
down_y
]
,
entrance
,
im_h
,
im_w
):
[
center_x
,
center_
y
],
entrance
,
im_h
,
im_w
):
in_id_list
.
append
(
track_id
)
prev_center
[
track_id
]
=
[
center_x
,
center_
down_
y
]
prev_center
[
track_id
]
=
[
center_x
,
center_y
]
else
:
prev_center
[
track_id
]
=
[
center_x
,
center_
down_
y
]
prev_center
[
track_id
]
=
[
center_x
,
center_y
]
# Count totol number, number at a manual-setting interval
frame_id
,
tlwhs
,
tscores
,
track_ids
=
result
...
...
deploy/pptracking/python/mot_jde_infer.py
浏览文件 @
73ef70f0
...
...
@@ -393,10 +393,21 @@ class JDE_Detector(Detector):
result
=
(
frame_id
+
1
,
online_tlwhs
[
0
],
online_scores
[
0
],
online_ids
[
0
])
statistic
=
flow_statistic
(
result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
,
data_type
,
num_classes
)
result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
,
data_type
,
ids2names
=
self
.
pred_config
.
labels
)
records
=
statistic
[
'records'
]
fps
=
1.
/
timer
.
duration
...
...
deploy/pptracking/python/mot_sde_infer.py
浏览文件 @
73ef70f0
...
...
@@ -634,10 +634,21 @@ class SDE_Detector(Detector):
result
=
(
frame_id
+
1
,
online_tlwhs
[
0
],
online_scores
[
0
],
online_ids
[
0
])
statistic
=
flow_statistic
(
result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
,
data_type
,
num_classes
)
result
,
self
.
secs_interval
,
self
.
do_entrance_counting
,
self
.
do_break_in_counting
,
self
.
region_type
,
video_fps
,
entrance
,
id_set
,
interval_id_set
,
in_id_list
,
out_id_list
,
prev_center
,
records
,
data_type
,
ids2names
=
self
.
pred_config
.
labels
)
records
=
statistic
[
'records'
]
fps
=
1.
/
timer
.
duration
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录