1 Star 0 Fork 7

云时之间/FaceRecognition

forked from Henry_Fung/FaceRecognition 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Detect_recognize_humanface.py 19.23 KB
一键复制 编辑 原始数据 按行查看 历史
Henry_Fung 提交于 2021-04-24 22:31 . Add the Face Detection Model
# coding:utf-8
import dlib
import numpy as np
from copy import deepcopy
import cv2
import os
from LiveDetection import detect_live
import torch
# http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat
# http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
class FaceRecognition(object):
def __init__(self, input_img,face_vector_model):
super(FaceRecognition, self).__init__()
self.input_img = input_img
self.detector = dlib.get_frontal_face_detector()
self.img_size = 150
self.predictor = dlib.shape_predictor(r'./shape_predictor_68_face_landmarks.dat')
self.recognition = dlib.face_recognition_model_v1('dlib_face_recognition_resnet_model_v1.dat')
self.live_threshold = 0.8
self.face_vector_model=face_vector_model
def point_draw(self, img, sp, title, save):
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
for i in range(68):
cv2.putText(img, str(i), (sp.part(i).x, sp.part(i).y), cv2.FONT_HERSHEY_DUPLEX, 0.3, (0, 0, 255), 1,
cv2.LINE_AA)
# cv2.drawKeypoints(img, (sp.part(i).x, sp.part(i).y),img, [0, 0, 255])
if save:
# filename = title+str(np.random.randint(100))+'.jpg'
filename = title + '.jpg'
cv2.imwrite(filename, img)
# os.system("open %s"%(filename))
# cv2.imshow(title, img)
# cv2.waitKey(0)
# cv2.destroyWindow(title)
def show_origin(self, img):
cv2.imshow('origin', img)
cv2.waitKey(0)
cv2.destroyWindow('origin')
def getfacefeature(self, image, check_live=False):
# import pdb
# pdb.set_trace()
# image = dlib.load_rgb_image(img)
## 人脸对齐、切图
# 人脸检测
dets = self.detector(image, 1)
if len(dets) == 1:
# faces = dlib.full_object_detections()
# 关键点提取
shape = self.predictor(image, dets[0])
print("Computing descriptor on aligned image ..")
# 人脸对齐 face alignment
images = dlib.get_face_chip(image, shape, size=self.img_size)
# self.point_draw(image, shape, 'before_' + img, save=True)
shapeimage = np.array(images).astype(np.uint8)
dets = self.detector(shapeimage, 1)
if len(dets) == 1:
point68 = self.predictor(shapeimage, dets[0])
# self.point_draw(shapeimage, point68, 'after_' + img, save=True)
# Live detection
if check_live:
resized_img = cv2.resize(image, (64, 64))
prob = detect_live(resized_img)
if prob < self.live_threshold:
return None
# 计算对齐后人脸的128维特征向量
# face_descriptor_from_prealigned_image = self.recognition.compute_face_descriptor(images)
model = torch.load(self.face_vector_model)
face_vector = model(images)
return face_vector
else:
return None
else:
return None
def compare(self):
# import pdb
# pdb.set_trace()
vec1 = self.getfacefeature(self.input_img, check_live=True)
if vec1 is None:
print('Not Real Person')
return False
else:
print("Have already detect live person")
vec1 = np.array(vec1)
vec2 = np.array(self.getfacefeature(self.src_img))
# import pdb
# pdb.set_trace()
dest = np.sqrt(np.sum((vec1 - vec2) * (vec1 - vec2)))
print('distance between people:{:.3f}'. \
format(dest))
return True
def getFaceEmbeddingVectors(self):
model = torch.load('\model.pkl')
def compareFromCamera(src_face_vector):
# 导入OpenCV
import cv2
# 创建一个VideoCapture对象,它的参数可以是设备索引或视频文件的名称(下面会讲到)。设备索引只是指定哪台摄像机的号码。0代表第一台摄像机、1代表第二台摄像机。之后,可以逐帧捕捉视频。最后释放捕获。
cap = cv2.VideoCapture(0)
while True:
# 读取帧
ret, frame = cap.read()
# 将视频灰度化
# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# 将视频灰度化显示
cv2.imshow('frame', frame)
detection_recognition = FaceRecognition( frame)
if detection_recognition.compare():
break
# 按‘q'退出
if cv2.waitKey(1) and 0xFF == ord('q'):
break
# 释放资源并关闭窗口
cap.release()
cv2.destroyAllWindows()
if __name__ == '__main__':
my_face_vector= [ 1.6443e-01, 2.1826e-01, 3.4180e-01, -3.3691e-01, 7.7576e-02,
-4.1290e-02, 2.1362e-01, -2.6758e-01, 2.7637e-01, -5.0391e-01,
-6.9092e-02, -2.3303e-01, 5.2826e-02, -2.1216e-01, 1.0907e-01,
4.9170e-01, 2.3499e-01, 1.2769e-01, -3.9697e-01, 2.2595e-01,
-3.5327e-01, 8.9893e-01, 1.1609e-01, 2.1021e-01, 2.9370e-01,
3.1201e-01, 4.2285e-01, 5.8398e-01, -7.8796e-02, -2.0471e-01,
-1.3208e-01, 4.5142e-01, -1.2671e-01, 1.7200e-01, -1.2720e-01,
-1.6406e-01, -2.0276e-01, -6.0645e-01, -4.4849e-01, -2.3743e-01,
-6.4258e-01, -1.0908e+00, 1.2830e-01, 4.0674e-01, 2.7734e-01,
-6.0272e-02, -3.4546e-01, 4.4141e-01, -9.8343e-03, 5.5322e-01,
4.1162e-01, 3.0420e-01, 4.0552e-01, 1.0236e-01, -2.7368e-01,
3.3887e-01, -1.8982e-01, -2.4695e-01, -1.4148e-01, 3.3350e-01,
1.4343e-01, -4.2114e-01, -1.6931e-01, -3.7427e-01, 3.5938e-01,
1.9556e-01, -1.6394e-01, 2.7466e-01, 1.1414e-01, -2.9419e-01,
-6.4844e-01, -3.4692e-01, -6.7627e-01, 2.7954e-01, -6.9763e-02,
2.8540e-01, -1.0144e-01, 2.5952e-01, -2.7612e-01, -4.5166e-01,
-3.7744e-01, -6.3818e-01, -1.2978e-02, 2.9688e-01, -1.6089e-01,
-1.1652e-01, -1.5784e-01, -2.9492e-01, 2.1497e-01, 2.6074e-01,
-6.4893e-01, -4.8730e-01, -4.6680e-01, -1.8341e-02, 3.6182e-01,
-2.8320e-02, -1.5211e-03, -3.6426e-01, -2.4500e-01, -2.9956e-01,
4.6997e-01, 4.2773e-01, 5.3101e-02, -5.3027e-01, -3.3081e-01,
-2.0618e-01, 5.2094e-02, 5.2881e-01, -5.1025e-01, 6.6797e-01,
-1.8103e-01, -2.6108e-02, -2.8247e-01, 6.0156e-01, -2.7979e-01,
-1.0181e-01, -6.2683e-02, -2.8003e-01, 3.0457e-02, 3.4399e-01,
-6.5820e-01, 2.8839e-02, 8.1848e-02, 4.7388e-01, 2.0837e-01,
3.5522e-01, -2.0288e-01, 3.3691e-01, 1.5955e-01, -4.2944e-01,
-3.1982e-01, -2.5952e-01, 8.2092e-02, 2.4976e-01, 4.2578e-01,
-2.4933e-02, -8.4045e-02, 4.5044e-01, -9.8938e-02, -6.0107e-01,
-1.3440e-01, -1.4172e-01, 2.6685e-01, -1.5088e-01, 1.0553e-01,
4.1870e-01, -2.6611e-01, 4.8633e-01, -1.6205e-02, -9.9670e-02,
1.3037e-01, -4.7437e-01, 1.6711e-01, -6.6528e-02, 1.5671e-02,
7.1533e-01, 9.6313e-02, -3.3594e-01, -3.7695e-01, -3.3154e-01,
-8.6975e-02, -2.0813e-01, 3.2715e-01, 5.1758e-02, -3.9282e-01,
3.0029e-01, -3.2837e-01, 2.9144e-02, -1.5511e-02, -1.5833e-01,
-3.8940e-01, 8.8318e-02, -2.0715e-01, -2.8662e-01, -6.4453e-02,
3.2153e-01, -3.9380e-01, -4.2212e-01, -7.0129e-02, 1.9324e-01,
-2.1716e-01, -2.3584e-01, 1.8567e-01, -2.9785e-01, 9.5032e-02,
1.9806e-02, 2.6099e-01, -2.3389e-01, 2.6025e-01, -5.0098e-01,
1.2634e-01, 2.0911e-01, 5.8691e-01, 1.9394e-02, 1.1151e-01,
1.3477e-01, 1.8359e-01, -4.9536e-01, 1.2646e-01, -1.1493e-01,
-8.2886e-02, 5.6091e-02, 6.0791e-01, 3.2568e-01, 7.1289e-01,
9.9792e-02, -1.5662e-01, -3.7280e-01, 2.2888e-01, 4.7949e-01,
1.6663e-01, -1.9702e-01, -3.8128e-03, -2.2754e-01, -5.3662e-01,
-1.6211e-01, -5.9521e-01, -2.4280e-01, 2.6660e-01, -1.3647e-01,
-4.8071e-01, -2.1899e-01, -5.1367e-01, -6.7383e-01, 3.2104e-01,
1.9531e-01, 1.8204e-02, -1.4343e-01, 3.1299e-01, 1.2903e-01,
7.2876e-02, -1.8187e-03, -3.5547e-01, 6.9702e-02, 2.0300e-01,
-2.2095e-02, -2.0630e-01, -1.9507e-01, -1.1871e-01, 2.2253e-01,
-1.1603e-01, 1.5979e-01, 4.3530e-01, 8.6365e-02, -3.6792e-01,
-6.4307e-01, 1.9495e-01, -1.4001e-01, 9.4528e-03, -1.4197e-01,
-1.1969e-01, 6.3330e-01, -2.4512e-01, 4.5776e-01, 2.7319e-01,
4.3286e-01, -5.4199e-02, 4.0796e-01, 1.5344e-01, 4.2676e-01,
4.5319e-02, 5.8740e-01, -2.8027e-01, -2.1204e-01, -1.2756e-01,
-3.0322e-01, -6.6260e-01, 1.2939e-01, -4.2139e-01, 3.9722e-01,
-4.2017e-01, 3.2910e-01, -3.2153e-01, 5.7227e-01, -4.4678e-02,
-1.3550e-01, -3.8477e-01, -2.4185e-02, -5.1178e-02, -2.9614e-01,
-5.7861e-01, -5.4346e-01, 3.3789e-01, -1.2866e-01, -1.1542e-01,
-3.0322e-01, -4.2358e-01, -6.2354e-01, 5.7910e-01, -2.6901e-02,
-3.2617e-01, -4.6570e-02, 5.2051e-01, -3.3789e-01, 3.2324e-01,
-3.7659e-02, 2.8369e-01, 1.1945e-01, 2.7618e-02, 1.5906e-01,
-3.3984e-01, -3.3594e-01, 1.4404e-01, -3.8501e-01, -8.4167e-02,
-2.1350e-01, -4.6216e-01, 1.3037e-01, 2.1594e-01, -5.7471e-01,
-5.0146e-01, 6.4990e-01, -4.7998e-01, 5.2246e-01, -4.3359e-01,
-9.8999e-02, -2.9590e-01, 1.8298e-01, 3.8849e-02, 3.4155e-01,
-3.9844e-01, -3.7384e-04, -1.6815e-02, -2.0776e-01, 2.4475e-01,
-4.6558e-01, 2.9858e-01, -2.8174e-01, -2.0081e-01, -3.1934e-01,
1.1890e-01, 1.6739e-02, 1.1981e-01, -3.9941e-01, 1.3092e-02,
2.1313e-01, -3.1226e-01, 5.3101e-02, 2.3206e-01, 8.7158e-01,
-4.6899e-01, 2.5269e-01, 1.3611e-01, -6.3232e-01, -1.8250e-01,
1.1499e-01, 1.9495e-01, 3.7988e-01, 3.0640e-01, 7.0129e-02,
-4.3274e-02, 5.3528e-02, -5.3613e-01, 1.9128e-01, -2.9419e-01,
3.3154e-01, 2.1545e-01, -2.3499e-01, 2.1118e-01, 2.4146e-01,
-1.3452e-01, -1.6736e-01, 3.5547e-01, -4.4287e-01, 1.6205e-02,
-2.5195e-01, 3.8013e-01, -3.5742e-01, -4.5142e-01, 2.2949e-01,
5.7324e-01, 3.5449e-01, 3.9990e-01, -1.2793e-01, 1.6016e-01,
2.5000e-01, 3.9233e-01, -3.7915e-01, 7.9407e-02, 4.6924e-01,
-2.8442e-01, -3.0396e-01, -4.4971e-01, -3.5889e-01, 1.6541e-01,
4.1064e-01, 3.2593e-01, 4.0283e-01, 2.6172e-01, 1.3928e-01,
1.1432e-01, -2.7710e-01, 6.4209e-01, 3.8696e-01, -4.3373e-03,
-1.3269e-01, -2.9846e-02, -1.6937e-02, 1.8054e-01, -2.9834e-01,
-9.9426e-02, 4.9390e-01, -1.3269e-01, -2.7222e-01, -7.3364e-02,
2.9761e-01, 2.9248e-01, 2.5439e-01, -2.5708e-01, 2.2571e-01,
-2.1069e-01, -3.3154e-01, -1.3342e-01, 2.6538e-01, -1.1902e-01,
1.8945e-01, -3.8672e-01, -3.6816e-01, 3.4668e-01, -3.5547e-01,
6.1670e-01, -2.2668e-01, 2.2974e-01, 8.4595e-02, 5.2734e-01,
4.8120e-01, 3.0835e-01, 2.1716e-01, 3.8574e-02, 2.8052e-01,
-1.1481e-01, 2.5537e-01, 2.6904e-01, -3.9697e-01, -7.3120e-02,
-1.4709e-01, 2.2400e-01, -1.2535e-02, 6.4307e-01, -4.7168e-01,
-3.1885e-01, -5.2441e-01, -4.2725e-01, -2.3239e-02, 3.5669e-01,
3.7744e-01, -7.8760e-01, -7.4219e-02, 5.7080e-01, -2.1594e-01,
1.7590e-01, 6.9519e-02, -2.2815e-01, -3.2422e-01, 2.8101e-01,
-5.1221e-01, 3.0591e-01, -5.2393e-01, -4.8535e-01, 3.8721e-01,
-3.0014e-02, -2.2263e-02, -2.4780e-01, 3.9307e-01, -1.3603e-02,
9.7107e-02, -5.2344e-01, -2.9175e-01, -1.4343e-01, -4.0088e-01,
-2.0782e-02, -2.1680e-01, 3.6499e-01, -1.4502e-01, 5.2588e-01,
4.3213e-01, 3.8574e-01, 1.0300e-02, 7.6599e-02, 3.8818e-02,
-7.9651e-02, -1.7603e-01, -3.3142e-02, 5.3528e-02, -7.9041e-02,
-5.8594e-01, -1.3208e-01, -3.5950e-02, -8.2886e-02, 6.1035e-02,
-6.8945e-01, 6.0944e-02, -2.6465e-01, -4.9951e-01, 3.3228e-01,
-3.6865e-01, -1.2488e-01, 9.4452e-03, 5.5859e-01, 1.7944e-01,
-3.1104e-01, -2.6709e-01, -1.0553e-01, -5.8740e-01, 1.8280e-02,
-3.8788e-02, 4.5850e-01, 2.1350e-01, 1.2854e-01, -5.7831e-02,
-4.5776e-01, -2.0032e-01, 1.2427e-01, 4.7656e-01, -2.1045e-01,
-2.9850e-04, -7.6416e-02, -4.8584e-01, -3.7048e-02, -6.8359e-02,
6.9287e-01, 7.0435e-02, -8.0933e-02, -4.5825e-01, -4.5746e-02,
1.2769e-01, -4.6600e-02, 6.5979e-02, -1.1670e-01, -3.0225e-01,
1.4551e-01, 8.0627e-02, -2.4072e-01, -4.9194e-01, -6.4746e-01,
1.0162e-01, -3.4448e-01, 1.1163e-01, -3.1396e-01, -1.6199e-01,
3.9136e-01, 2.1988e-02, 1.8933e-01, -9.1370e-02, 3.9722e-01,
2.2119e-01, 4.6851e-01, -5.9753e-02, -2.7783e-01, -3.7036e-01,
2.7075e-01, 4.4507e-01, -1.1560e-01, 2.9816e-02, -4.9097e-01,
-4.5703e-01, 1.8631e-02, -2.1667e-01, -3.0411e-02, 1.0950e-01,
-6.3086e-01, -2.1106e-01, -8.6731e-02, -2.2449e-01, -2.3242e-01,
1.8286e-01, 2.5781e-01, 2.2571e-01, -3.7012e-01, -7.6050e-02,
9.1003e-02, -1.8884e-01, 2.6099e-01, -9.3002e-03, 1.4183e-02,
3.3716e-01, 4.7925e-01, 8.3862e-02, -1.3684e-01, 4.0112e-01,
-3.7500e-01, -4.6851e-01, 2.2485e-01, 2.9761e-01, -7.5073e-02,
-2.6245e-01, -3.4332e-02, 3.3301e-01, 5.4932e-01, -2.9810e-01,
1.1298e-01, 4.4629e-01, -1.1462e-01, 2.6001e-01, -2.3804e-01,
-1.8005e-01, -4.9707e-01, 2.4817e-01, -2.6733e-01, 1.8738e-01,
2.7313e-03, 4.5728e-01, -4.6997e-01, 1.3748e-02, -2.0898e-01,
1.8127e-01, 1.5930e-01, 5.2441e-01, -2.3880e-02, -3.8525e-01,
5.6104e-01, 2.3352e-01, -2.4854e-01, -4.4653e-01, 2.1619e-01,
-5.3040e-02, -2.9510e-02, -5.3809e-01, -2.0032e-01, -3.6652e-02,
2.4524e-01, -2.6440e-01, -2.1570e-01, 4.6655e-01, 2.7405e-02,
-3.5352e-01, 6.8726e-02, -1.9287e-01, -3.5059e-01, -4.5557e-01,
-5.0879e-01, 2.7246e-01, 3.5010e-01, 6.8481e-02, -4.2871e-01,
4.2334e-01, -2.4231e-01, 2.6636e-01, 1.3770e-01, 3.4766e-01,
2.5122e-01, 2.0581e-01, 2.9150e-01, 1.2262e-01, 2.0679e-01,
-4.5142e-01, -5.5273e-01, 4.9512e-01, 3.9966e-01, 2.1838e-01,
-1.9971e-01, 2.4133e-01, 1.6553e-01, 5.3516e-01, 1.9714e-01,
5.8838e-01, 1.1621e-01, -1.2177e-01, 1.0260e-01, 2.2461e-01,
2.7222e-01, 2.2095e-01, 3.6060e-01, 2.6050e-01, 6.0352e-01,
1.5112e-01, -3.6865e-01, 1.0291e-01, 4.5996e-01, 1.3293e-01,
-5.0926e-03, 5.3955e-01, -1.7761e-01, 3.9575e-01, -3.9703e-02,
4.0576e-01, -2.6074e-01, 3.1714e-01, -4.5728e-01, -5.2277e-02,
-3.1812e-01, 3.8605e-02, -7.4121e-01, 2.7490e-01, 1.9824e-01,
3.2520e-01, -1.9080e-01, 3.0444e-01, 2.9883e-01, -2.1582e-01,
-4.7852e-01, 6.4636e-02, -2.5757e-01, 3.4814e-01, -3.0054e-01,
-1.7395e-01, -3.4473e-01, -2.8271e-01, 7.2266e-02, -2.5244e-01,
3.1738e-01, -4.5264e-01, 1.9360e-01, 1.0602e-01, -5.0488e-01,
-6.1377e-01, 1.3000e-01, 3.9990e-01, 1.2219e-01, -1.9775e-01,
-2.3438e-02, 4.2529e-01, -1.5308e-01, 1.9287e-01, 5.8533e-02,
3.1079e-01, 8.5388e-02, -1.9336e-01, -2.4133e-01, 5.4541e-01,
-9.9426e-02, -5.3955e-01, -3.0041e-03, 1.0455e-01, 4.4482e-01,
3.9478e-01, -2.9004e-01, 9.6985e-02, 4.7778e-01, 3.8086e-01,
-8.7036e-02, 2.3694e-01, 5.8545e-01, -3.0396e-01, 7.4414e-01,
2.2034e-01, 6.0498e-01, 4.5239e-01, -5.2490e-02, -6.3965e-01,
-4.1650e-01, 2.5610e-01, 3.4180e-01, -1.8140e-01, -2.9556e-02,
9.0881e-02, -2.2009e-01, -5.8350e-02, 2.0349e-01, 6.0303e-01,
-2.2852e-01, 4.6851e-01, -3.3234e-02, -6.2891e-01, 5.7666e-01,
-3.5815e-01, 5.0439e-01, 5.1514e-01, -3.7207e-01, 7.5317e-02,
-6.2622e-02, 6.5332e-01, -3.8135e-01, -3.2690e-01, -8.8318e-02,
-3.1815e-03, 2.7344e-01, -5.2460e-02, 6.2408e-02, 3.0334e-02,
2.5436e-02, -1.6113e-01, -3.9825e-02, 3.2495e-01, 1.0712e-01,
-3.2153e-01, 5.1660e-01, -1.2231e-01, -1.7993e-01, -1.6406e-01,
2.6367e-01, 2.5854e-01, 2.2974e-01, -1.7053e-01, -2.8778e-02,
4.8413e-01, -6.4758e-02, 4.5776e-02, 5.0244e-01, -5.0439e-01,
9.5581e-02, 3.2251e-01, 1.0461e-01, -2.7954e-01, -5.1709e-01,
3.1519e-01, 5.2832e-01, 3.4714e-03, -1.1115e-01, 1.1407e-01,
-3.4424e-01, 1.2573e-01, -1.0980e-01, -3.7134e-01, 3.3105e-01,
2.0129e-01, 1.0541e-01, 5.4199e-01, -1.1176e-01, 5.6946e-02,
-2.6050e-01, 2.2852e-01, 4.0112e-01, 1.6321e-01, -3.5840e-01,
2.1252e-01, -1.9470e-01, 2.2314e-01, 7.0410e-01, -3.5425e-01,
2.0862e-01, 2.1826e-01, 1.2000e-01, 2.5854e-01, -1.9519e-01,
9.6069e-02, -4.3018e-01, -3.9282e-01, 6.6833e-02, -9.1431e-02,
-4.7681e-01, -3.1641e-01, -3.8916e-01, -4.0039e-01, 1.9604e-01,
-4.7485e-02, 2.5928e-01, 4.4360e-01, -4.5020e-01, 4.4873e-01,
-3.4943e-02, -5.0146e-01, 1.0388e-01, -2.8979e-01, -5.0146e-01,
-2.6660e-01, -4.7388e-01, -4.2206e-02, 3.9233e-01, -1.6162e-01,
7.4609e-01, -9.6375e-02, -2.9053e-01, -3.2031e-01, 3.7670e-03,
-2.1021e-01, -1.1993e-02, -2.5830e-01, 2.4817e-01, -9.5886e-02,
3.9978e-02, -2.0398e-01, -1.2610e-01, -5.2441e-01, 1.1359e-01,
3.7866e-01, 4.7656e-01, 2.3877e-01, -2.9053e-01, -1.7041e-01,
3.4912e-02, -2.5098e-01, 1.3037e-01, -3.4692e-01, 3.5864e-01,
2.1130e-01, -3.9648e-01, -3.6743e-01, 9.5764e-02, -1.6675e-01,
3.8135e-01, -4.5532e-02, 3.9886e-02, -1.0687e-01, -2.8223e-01,
-2.4963e-01, 3.8818e-01, 3.2153e-01, 1.2402e-01, -3.0859e-01,
4.5630e-01, -1.9043e-01, 3.8818e-01, -5.6396e-01, 3.9258e-01,
4.2383e-01, -1.7542e-01, 3.7549e-01, 2.6758e-01, -1.8237e-01,
-2.4268e-01, -3.1641e-01, -4.0039e-01, 1.3684e-01, -7.0618e-02,
3.7817e-01, -4.6240e-01, 2.3938e-01, -1.4038e-01, -9.6741e-02,
-1.7786e-01, -1.2317e-01, 2.2131e-01, -1.1407e-01, -1.2585e-01,
5.9540e-02, -6.2012e-02, -1.2152e-01, -2.3047e-01, 6.5422e-03,
2.1021e-01, -1.7810e-01, 3.4497e-01, 8.3435e-02, -2.0447e-01,
2.0435e-01, 2.8027e-01, 2.3401e-01, 2.9907e-01, -2.1667e-01,
1.7542e-01, 4.0398e-03, 3.3496e-01, 3.6469e-02, -2.4463e-01,
-4.5117e-01, -2.5903e-01, -5.1727e-02, 2.5708e-01, 1.7175e-01,
-4.1992e-01, -1.5222e-01, 3.5840e-01, 7.9834e-02, 5.0537e-01,
1.0992e-01, 1.2720e-01, 1.9250e-01, 4.3237e-01, 7.5562e-02,
3.8135e-01, 1.4050e-01, -3.0103e-01, 3.0908e-01, 6.0693e-01,
8.8882e-03, 2.3779e-01, 3.7744e-01, -4.3604e-01, 2.9297e-01,
8.6304e-02, -2.4829e-01, 5.8740e-01, 5.2832e-01, -9.9792e-02,
-2.3145e-01, 3.5889e-01, -7.2937e-02, 4.5142e-01, 4.5825e-01,
-2.4255e-01, 8.2855e-03, -3.1812e-01, -4.4556e-01, 1.7639e-01,
-1.6638e-01, 1.3147e-01, 1.4038e-01, -3.4821e-02, 2.2522e-01,
1.5674e-01, 3.4729e-02, -5.4443e-01, 9.2590e-02, 4.0845e-01,
-2.2003e-02, -3.7183e-01, -1.3147e-01, -4.9365e-01, 3.6182e-01,
-1.6394e-01, -2.4805e-01, 6.9519e-02, 2.8540e-01, -7.3051e-03,
4.8462e-01, 5.3027e-01, 2.1448e-01, 1.0522e-01, -5.2295e-01]
compareFromCamera(my_face_vector,'models/cbam18.pkl')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yunshizhijian/face-recognition.git
git@gitee.com:yunshizhijian/face-recognition.git
yunshizhijian
face-recognition
FaceRecognition
master

搜索帮助