-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arcface人脸特征提取不同人脸,计算的相似度都一样,是怎么回事呢? #36
Comments
a = np.random.rand(1, 8) |
我按照你上述的公式: |
@shouxieai AttributeError: 'trtpy.libtrtpyc.FaceBox' object has no attribute 'width' |
重新编译后解决 |
@shouxieai arcface在进行特征提取的时候,为什么需要输入人脸关键点呢?retinaface中有一个函数crop_face_and_landmark裁剪的人脸很大,我想自己裁剪人脸,然后输入到arcface中进行特征提取,应该怎么做呢,之所以这样做,是因为发现提取有些同一个 |
余弦距离计算代码:
def cosine_distance(matrix1, matrix2):
matrix1_matrix2 = np.dot(matrix1, matrix2.transpose())
matrix1_norm = np.sqrt(np.multiply(matrix1, matrix1).sum(axis=1))
matrix1_norm = matrix1_norm[:, np.newaxis]
matrix2_norm = np.sqrt(np.multiply(matrix2, matrix2).sum(axis=1))
matrix2_norm = matrix2_norm[:, np.newaxis]
cosine_distance = np.divide(matrix1_matrix2, np.dot(matrix1_norm, matrix2_norm.transpose()))
return cosine_distance
是不是没有进行归一化呢,归一化有没有好的函数推荐呢?
The text was updated successfully, but these errors were encountered: