Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/007gzs/xface
https://github.com/007gzs/xface
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/007gzs/xface
- Owner: 007gzs
- License: mit
- Created: 2021-03-17T04:51:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-03-19T07:26:07.000Z (over 3 years ago)
- Last Synced: 2024-09-26T09:25:29.296Z (about 2 months ago)
- Language: Python
- Size: 15.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
###########
XFace
###########.. image:: https://img.shields.io/pypi/v/xface.svg
:target: https://pypi.org/project/xface安装与升级
==========为了简化安装过程,推荐使用 pip 进行安装
.. code-block:: bash
pip install xface
升级 Django Cool 到新版本::
pip install -U xface
如果需要安装 GitHub 上的最新代码::
pip install https://github.com/007gzs/xface/archive/master.zip
快速使用
==========注册+识别::
import xface
import cv2face_analysis = xface.FaceAnalysis()
face_analysis.load()
for i in range(5):
image = cv2.imread("label%d.jpg" % i)
faces = face_analysis.get_faces(image, max_num=1)
if faces:
face_analysis.register_face("label%d" % i, faces[0].feature)
faces = face_analysis.get_faces(image)
res = [
{
'bbox': face.bbox,
'det_score': face.det_score,
'landmark': face.landmark,
'landmark_106': face.landmark_106,
'sim_face_ids': [{'face_id': face_id, 'sim': float(sim)} for face_id, sim in face.sim_face_ids or []]
}
for face in faces
]
print(res)