OFace.
Project description
安装与升级
为了简化安装过程,推荐使用 pip 进行安装
pip install oface
升级 OFace 到新版本:
pip install -U oface
如果需要安装 GitHub 上的最新代码:
pip install https://github.com/007gzs/oface/archive/master.zip
预训练模型下载地址
百度云下载 提取码:face
快速使用
注册+识别:
import oface
import cv2
MODEL_PATH = os.path.join(os.path.dirname(__file__), "models")
face_analysis = oface.FaceAnalysis(model_path=MODEL_PATH)
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)
image = cv2.imread("test.jpg")
faces = face_analysis.get_faces(image)
res = [
{
'bbox': face.bbox,
'det_score': face.det_score,
'landmark': face.landmark,
'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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oface-0.1.12.tar.gz
(10.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
oface-0.1.12-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file oface-0.1.12.tar.gz.
File metadata
- Download URL: oface-0.1.12.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20bf9c17055d052215ea8674a0aa83ab2e020f82121fe5d7eeae26de4160a086
|
|
| MD5 |
609d33ebc8bf4b82705f0a7c5a1acd33
|
|
| BLAKE2b-256 |
6c196cd0c371278492035702c53d66caafa88ec4b3cc794a177d1a6b69d4b019
|
File details
Details for the file oface-0.1.12-py3-none-any.whl.
File metadata
- Download URL: oface-0.1.12-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e32c278165ea2a28b1b2d92dbdca6f3e3bc9f4adf5fd2b9371d1ae7b20c3e0c
|
|
| MD5 |
842f62b70be2e7f5638e81fc8b845421
|
|
| BLAKE2b-256 |
2f96daf2703c875ebc3195aca9bb2f59be1af20889ef2d878f4f498fe4471a91
|