- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在探索 python 中的 face_recognition https://github.com/ageitgey/face_recognition
目前,我将 face_encoding 存储在一个字符串中。您可以看到我如何转换为字符串数组,以便将其保存在数据库中。
unknown_image = face_recognition.load_image_file("biden.jpg")
face_location_unknown = face_recognition.face_locations(unknown_image)
unknown_encoding = face_recognition.face_encodings(unknown_image, face_location_unknown)[0]
#conversion to string
unknown_encoding_string = "%s" % unknown_encoding
face_unknown_encoding_string = re.sub('\s+', ', ', unknown_encoding_string[1:-1])
“face_unknown_encoding_string”是这样的:
"-0.127419,0.0709146,0.0794749,-0.0321613,-0.0159098,0.00918037,-0.0360131,-0.0601268,0.0995623,-0.106627,0.253107,-0.00910004,-0.236208,-0.164839,0.0281254,0.173948,-0.157076,-0.099059,-0.0318014,-0.0617558,0.0104656,-0.00391768,0.0300188,0.082264,-0.116754,-0.42047,-0.112592,-0.124656,-0.0288262,-0.0780776,-0.0982438,0.0630722,-0.158208,-0.00986074,-0.044616,0.0979513,0.00402067,-7.38486e-05,0.140721,0.0392284,-0.180724,0.011891,0.000132522,0.247319,0.166832,0.0565608,0.022775,-0.0209147,0.040387,-0.172158,0.087646,0.134213,0.0793414,0.0392115,0.00153742,-0.118472,-0.0423868,0.0155273,-0.114884,0.0150463,-0.0130648,-0.136907,-0.0396041,-0.0299826,0.192542,0.107253,-0.102995,-0.147908,0.133909,-0.149223,-0.0397335,0.046862,-0.158645,-0.165123,-0.318725,0.13189,0.36383,0.134758,-0.162269,0.0299262,-0.12019,-0.0473435,0.0974606,0.13637,-0.0189891,0.00880722,-0.0928411,0.063979,0.139967,-0.0451124,-0.0430897,0.214811,-0.0380436,0.131413,0.0137761,0.0366569,-0.0442467,0.0497605,-0.0790947,0.00948556,0.0879658,-0.0556417,0.00738802,0.0854838,-0.15242,0.0731073,0.0232722,0.00448165,0.0829161,0.0995341,-0.163955,-0.143655,0.125336,-0.239622,0.174127,0.243117,0.0262358,0.122618,0.137583,0.109123,-0.00857285,-0.074666,-0.184109,0.00498615,0.131001,0.0170561,0.0319808,0.0229446,",
问题是我如何转换它
face_unknown_encoding_string
回到与“unknown_encoding”相同的编码格式?
原因是我现在想使用“compare_faces”进行比较
最佳答案
上帝,那个评论者没用。
我有一个非常相似的问题,我需要将一堆序列化的面部编码与一个新的面部编码进行比较,看看它是否是同一个人,因此解决了:
face_recognition.compare_faces(np.array(json.loads(person.face_encodings)), np.array(json.loads(unrecognized_rectangle.face_encoding)))
关于python - face_recognition 编码从字符串回到 python 中的原始编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49513818/
我是编程新手。我已将 dlib 添加到我的 xcode 项目中,如示例中所示 https://github.com/zweigraf/face-landmarking-ios .而且效果很好。 如何添
我正在同时使用开放式简历和人脸识别,但是下面这行代码: biden_encoding = face_recognition.face_encodings(known_image)[0] 给我以下错误:
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭5 年前。 Improve this quest
import face_recognition image = face_recognition.load_image_file("My_Image.png") face_locations = fa
我正在探索 python 中的 face_recognition https://github.com/ageitgey/face_recognition 目前,我将 face_encoding 存储
我在 Google Colab 工作并且已经导入了 dlib !pip install dlib import dlib 并安装了face_recognition模块。 !pip install fa
我尝试使用 "conda install face_recognition -c conda-forge face_recognition" 安装 face_recognition 包 并遇到以下错误
我有face_recognition python脚本,如果执行可以正常运行,但是如果执行则随机显示错误: Traceback (most recent call last): File
我正在尝试制作一个可以用图像填充眼睛的眼睛替换程序。为了找到眼睛,我使用了 Ageitgey 的 face_recognition。然而,眼睛检测结果非常参差不齐。 (我不是在谈论抗锯齿,顺便说一句。
import face_recognition import cv2 import os, os.path import numpy as np count = 0 def finding_membe
我是 PyCharm 新手,正在尝试一些面部识别功能。我的工作需要一个face_recogniton库,它是使用以下命令安装的(我使用Ubuntu 18.04作为我的操作系统): pip instal
我使用 face_recognition 模块进行编程,当我尝试为 Windows 制作 .exe 文件时,它不起作用。也许 smb 可以告诉我该怎么做? 最佳答案 从这里下载文件 shape_pre
我已经有了 dlib 19.1.0 并打开了 cv 3.4.5 和 numpy,scipy 高级版本的包,但是使用 pip install face_recognition 我收到以下错误..请任何人
我是一名优秀的程序员,十分优秀!