安装与升级
为了简化安装过程,推荐使用 pip 进行安装
pip install xface
升级 Django Cool 到新版本:
pip install -U xface
如果需要安装 GitHub 上的最新代码:
pip install https://github.com/007gzs/xface/archive/master.zip
快速使用
注册+识别:
import xface
import cv2
face_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)
Metadata
Release files for xface 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xface-0.1.0.tar.gz | 23.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xface-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.7 MB
Release files / xface-0.1.0.tar.gz
| Download URL | xface-0.1.0.tar.gz |
|---|---|
| Size | 23.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95fc4ce0d53b1df59f61ac8f69f1e995f4d07e89c19d01647ffc700e11526d73
|
|
BLAKE2b-256 checksum How to use checksums |
8e4f2ea04847230655410ffa8cd7287510209aaf7690ac01c6e3a7681caf1934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / xface-0.1.0-py3-none-any.whl
| Download URL | xface-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8101f3387553795adc8e3cf291bf857ac4cfa7ddb9277c311a1fabbbb87a284
|
|
BLAKE2b-256 checksum How to use checksums |
9c364e682566401f5f6708101f29712e7302ae83a753e2dd1ebc83a0b649ead1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|