为什么有显卡,速度还是特别慢啊
lilonglilong opened this issue · comments
lilonglilong commented
Zhengtian Xie commented
速度慢是因为对比的时候,对于出现的人脸X,要和数据库里面所有的人脸进行实时的欧式距离计算,是串行的运算,你可以开多个线程并行同时去做 return_euclidean_distance();
不是视频 encode/decode 的 workload 重,是上面说的计算欧式距离运算量大,所以和显卡没关系,如果你是 N 卡,可以用 CUDA 进行加速,要重写代码(原理和多线程一回事),是另一回事了
对于某张人脸,遍历所有存储的人脸特征
# For every faces detected, compare the faces in the database
e_distance_list = []
for i in range(len(features_known_arr)):
# 如果 person_X 数据不为空
if str(features_known_arr[i][0]) != '0.0':
print("with person", str(i + 1), "the e distance: ", end='')
e_distance_tmp = return_euclidean_distance(features_cap_arr[k], features_known_arr[i])
lilonglilong commented
好的,谢谢!
谢谢来信!
…------------------ 原始邮件 ------------------
发件人: "Xie Zhengtian"<notifications@github.com>;
发送时间: 2019年12月4日(星期三) 晚上9:53
收件人: "coneypo/Dlib_face_recognition_from_camera"<Dlib_face_recognition_from_camera@noreply.github.com>;
抄送: "The man"<1401325952@qq.com>;"Author"<author@noreply.github.com>;
主题: Re: [coneypo/Dlib_face_recognition_from_camera] 为什么有显卡,速度还是特别慢啊 (#14)
速度慢是因为对比的时候,对于出现的人脸X,要和数据库里面所有的人脸进行实时的欧式距离计算,是串行的运算,你可以开多个线程并行同时去做 return_euclidean_distance();
不是视频 encode/decode 的 workload 重,是上面说的计算欧式距离运算量大,所以和显卡没关系,如果你是 N 卡,可以用 CUDA 进行加速,要重写代码(原理和多线程一回事),是另一回事了
对于某张人脸,遍历所有存储的人脸特征
# For every faces detected, compare the faces in the database e_distance_list = [] for i in range(len(features_known_arr)): # 如果 person_X 数据不为空 if str(features_known_arr[i][0]) != '0.0': print("with person", str(i + 1), "the e distance: ", end='') e_distance_tmp = return_euclidean_distance(features_cap_arr[k], features_known_arr[i])
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.