Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
深夜独行侠
dpcas
提交
4be6c483
dpcas
项目概览
深夜独行侠
/
dpcas
与 Fork 源项目一致
Fork自
DataBall / dpcas
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
dpcas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4be6c483
编写于
4月 22, 2021
作者:
DataBall
🚴🏻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
b2c87e4f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
12 deletion
+26
-12
applications/wyw2s_local_app.py
applications/wyw2s_local_app.py
+23
-9
components/face_detect/yolo_v3_face.py
components/face_detect/yolo_v3_face.py
+3
-3
未找到文件。
applications/wyw2s_local_app.py
浏览文件 @
4be6c483
...
...
@@ -22,10 +22,10 @@ import time
from
multiprocessing
import
Process
from
multiprocessing
import
Manager
import
cv2
import
numpy
as
np
import
random
import
time
import
shutil
# 加载模型组件库
from
face_detect.yolo_v3_face
import
yolo_v3_face_model
...
...
@@ -41,15 +41,28 @@ from utils.show_videos_thread import run_show
from
moviepy.editor
import
*
def
main_wyw2s
(
cfg_file
,
video_path
=
Non
e
):
def
main_wyw2s
(
video_path
,
cfg_fil
e
):
config
=
parse_data_cfg
(
cfg_file
)
face_detect_model
=
yolo_v3_face_model
(
conf_thres
=
0.43
)
face_verify_model
=
insight_face_model
(
threshold
=
1.2
)
face_multitask_model
=
FaceMuitiTask_Model
()
face_euler_model
=
FaceAngle_Model
()
print
(
"
\n
/---------------------- main_wyw2s config ------------------------/
\n
"
)
for
k_
in
config
.
keys
():
print
(
"{} : {}"
.
format
(
k_
,
config
[
k_
]))
print
(
"
\n
/------------------------------------------------------------------------/
\n
"
)
print
(
"
\n
loading who you want 2 see local demo ...
\n
"
)
face_detect_model
=
yolo_v3_face_model
(
conf_thres
=
float
(
config
[
"detect_conf_thres"
]),
nms_thres
=
float
(
config
[
"detect_nms_thres"
]),
model_arch
=
config
[
"detect_model_arch"
],
model_path
=
config
[
"detect_model_path"
],
yolo_anchor_scale
=
float
(
config
[
"yolo_anchor_scale"
]),
img_size
=
float
(
config
[
"detect_input_size"
]),
)
face_verify_model
=
insight_face_model
(
backbone_model_path
=
config
[
"face_verify_backbone_path"
]
,
facebank_path
=
config
[
"facebank_path"
],
threshold
=
float
(
config
[
"face_verify_threshold"
]))
face_multitask_model
=
FaceMuitiTask_Model
(
model_path
=
config
[
"face_multitask_model_path"
])
face_euler_model
=
FaceAngle_Model
(
model_path
=
config
[
"face_euler_model_path"
])
print
(
"
\n
/------------------------------------------------------------------------/
\n
"
)
YouWantToSee
=
config
[
"YouWantToSee"
]
...
...
@@ -74,7 +87,6 @@ def main_wyw2s(cfg_file,video_path = None):
else
:
p_colors
.
append
((
random
.
randint
(
60
,
255
),
random
.
randint
(
70
,
255
),
random
.
randint
(
130
,
255
)))
cap
=
cv2
.
VideoCapture
(
video_path
)
frame_count
=
int
(
cap
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
...
...
@@ -88,7 +100,6 @@ def main_wyw2s(cfg_file,video_path = None):
frame_idx
=
0
Flag_Last
,
Flag_Now
=
False
,
False
start_time
=
0.
end_time
=
0.
YouWantToSee_time_list
=
[]
while
cap
.
isOpened
():
...
...
@@ -124,7 +135,6 @@ def main_wyw2s(cfg_file,video_path = None):
print
(
" ------ "
)
Flag_Now
=
False
else
:
face_map
=
np
.
zeros
([
112
*
3
,
112
*
3
,
3
]).
astype
(
np
.
uint8
)
face_map
[:,:,
0
].
fill
(
205
)
...
...
@@ -180,6 +190,10 @@ def main_wyw2s(cfg_file,video_path = None):
print
(
"
\n
----->>> YouWantToSee_Time_list :
\n
"
)
movie
=
VideoFileClip
(
video_path
)
video_s
=
"./clip_wyw2s/"
if
os
.
path
.
exists
(
video_s
):
#删除之前的文件夹
shutil
.
rmtree
(
video_s
)
if
not
os
.
path
.
exists
(
video_s
):
# 如果文件夹不存在
os
.
mkdir
(
video_s
)
# 生成文件夹
...
...
components/face_detect/yolo_v3_face.py
浏览文件 @
4be6c483
...
...
@@ -10,9 +10,9 @@ import time
import
torch
from
hand
_detect.yolov3
import
Yolov3
,
Yolov3Tiny
from
hand
_detect.utils.torch_utils
import
select_device
from
hand
_detect.acc_model
import
acc_model
from
face
_detect.yolov3
import
Yolov3
,
Yolov3Tiny
from
face
_detect.utils.torch_utils
import
select_device
from
face
_detect.acc_model
import
acc_model
import
torch.backends.cudnn
as
cudnn
import
torch.nn.functional
as
F
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录