安装与升级
为了简化安装过程,推荐使用 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)
Metadata
Release files for oface 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oface-0.1.12.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oface-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / oface-0.1.12.tar.gz
| Download URL | oface-0.1.12.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20bf9c17055d052215ea8674a0aa83ab2e020f82121fe5d7eeae26de4160a086
|
|
BLAKE2b-256 checksum How to use checksums |
6c196cd0c371278492035702c53d66caafa88ec4b3cc794a177d1a6b69d4b019
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / oface-0.1.12-py3-none-any.whl
| Download URL | oface-0.1.12-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e32c278165ea2a28b1b2d92dbdca6f3e3bc9f4adf5fd2b9371d1ae7b20c3e0c
|
|
BLAKE2b-256 checksum How to use checksums |
2f96daf2703c875ebc3195aca9bb2f59be1af20889ef2d878f4f498fe4471a91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|