Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
深夜独行侠
dpcas
提交
4be6c483
dpcas
项目概览
深夜独行侠
/
dpcas
与 Fork 源项目一致
Fork自
Eric.Lee2021 / 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,体验更适合开发者的 AI 搜索 >>
提交
4be6c483
编写于
4月 22, 2021
作者:
Eric.Lee2021
🚴🏻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
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
...
@@ -22,10 +22,10 @@ import time
from
multiprocessing
import
Process
from
multiprocessing
import
Process
from
multiprocessing
import
Manager
from
multiprocessing
import
Manager
import
cv2
import
numpy
as
np
import
numpy
as
np
import
random
import
random
import
time
import
time
import
shutil
# 加载模型组件库
# 加载模型组件库
from
face_detect.yolo_v3_face
import
yolo_v3_face_model
from
face_detect.yolo_v3_face
import
yolo_v3_face_model
...
@@ -41,15 +41,28 @@ from utils.show_videos_thread import run_show
...
@@ -41,15 +41,28 @@ from utils.show_videos_thread import run_show
from
moviepy.editor
import
*
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
)
config
=
parse_data_cfg
(
cfg_file
)
face_detect_model
=
yolo_v3_face_model
(
conf_thres
=
0.43
)
print
(
"
\n
/---------------------- main_wyw2s config ------------------------/
\n
"
)
face_verify_model
=
insight_face_model
(
threshold
=
1.2
)
for
k_
in
config
.
keys
():
face_multitask_model
=
FaceMuitiTask_Model
()
print
(
"{} : {}"
.
format
(
k_
,
config
[
k_
]))
face_euler_model
=
FaceAngle_Model
()
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
"
)
print
(
"
\n
/------------------------------------------------------------------------/
\n
"
)
YouWantToSee
=
config
[
"YouWantToSee"
]
YouWantToSee
=
config
[
"YouWantToSee"
]
...
@@ -74,7 +87,6 @@ def main_wyw2s(cfg_file,video_path = None):
...
@@ -74,7 +87,6 @@ def main_wyw2s(cfg_file,video_path = None):
else
:
else
:
p_colors
.
append
((
random
.
randint
(
60
,
255
),
random
.
randint
(
70
,
255
),
random
.
randint
(
130
,
255
)))
p_colors
.
append
((
random
.
randint
(
60
,
255
),
random
.
randint
(
70
,
255
),
random
.
randint
(
130
,
255
)))
cap
=
cv2
.
VideoCapture
(
video_path
)
cap
=
cv2
.
VideoCapture
(
video_path
)
frame_count
=
int
(
cap
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
frame_count
=
int
(
cap
.
get
(
cv2
.
CAP_PROP_FRAME_COUNT
))
...
@@ -88,7 +100,6 @@ def main_wyw2s(cfg_file,video_path = None):
...
@@ -88,7 +100,6 @@ def main_wyw2s(cfg_file,video_path = None):
frame_idx
=
0
frame_idx
=
0
Flag_Last
,
Flag_Now
=
False
,
False
Flag_Last
,
Flag_Now
=
False
,
False
start_time
=
0.
start_time
=
0.
end_time
=
0.
YouWantToSee_time_list
=
[]
YouWantToSee_time_list
=
[]
while
cap
.
isOpened
():
while
cap
.
isOpened
():
...
@@ -124,7 +135,6 @@ def main_wyw2s(cfg_file,video_path = None):
...
@@ -124,7 +135,6 @@ def main_wyw2s(cfg_file,video_path = None):
print
(
" ------ "
)
print
(
" ------ "
)
Flag_Now
=
False
Flag_Now
=
False
else
:
else
:
face_map
=
np
.
zeros
([
112
*
3
,
112
*
3
,
3
]).
astype
(
np
.
uint8
)
face_map
=
np
.
zeros
([
112
*
3
,
112
*
3
,
3
]).
astype
(
np
.
uint8
)
face_map
[:,:,
0
].
fill
(
205
)
face_map
[:,:,
0
].
fill
(
205
)
...
@@ -180,6 +190,10 @@ def main_wyw2s(cfg_file,video_path = None):
...
@@ -180,6 +190,10 @@ def main_wyw2s(cfg_file,video_path = None):
print
(
"
\n
----->>> YouWantToSee_Time_list :
\n
"
)
print
(
"
\n
----->>> YouWantToSee_Time_list :
\n
"
)
movie
=
VideoFileClip
(
video_path
)
movie
=
VideoFileClip
(
video_path
)
video_s
=
"./clip_wyw2s/"
video_s
=
"./clip_wyw2s/"
if
os
.
path
.
exists
(
video_s
):
#删除之前的文件夹
shutil
.
rmtree
(
video_s
)
if
not
os
.
path
.
exists
(
video_s
):
# 如果文件夹不存在
if
not
os
.
path
.
exists
(
video_s
):
# 如果文件夹不存在
os
.
mkdir
(
video_s
)
# 生成文件夹
os
.
mkdir
(
video_s
)
# 生成文件夹
...
...
components/face_detect/yolo_v3_face.py
浏览文件 @
4be6c483
...
@@ -10,9 +10,9 @@ import time
...
@@ -10,9 +10,9 @@ import time
import
torch
import
torch
from
hand
_detect.yolov3
import
Yolov3
,
Yolov3Tiny
from
face
_detect.yolov3
import
Yolov3
,
Yolov3Tiny
from
hand
_detect.utils.torch_utils
import
select_device
from
face
_detect.utils.torch_utils
import
select_device
from
hand
_detect.acc_model
import
acc_model
from
face
_detect.acc_model
import
acc_model
import
torch.backends.cudnn
as
cudnn
import
torch.backends.cudnn
as
cudnn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录