A face detection library based on libfacedetection
Project description
Yuface
Introduction
A super fast face detector packaged by the libfacedetection repository using pybind11.
Change Log
[2023-5-8] Project init.
Quick start
pip install yuface
Usage
- Load image
# opencv
import cv2
img = cv2.imread('xxx.jpg')
# PIL
import PIL
import numpy as np
img = PIL.Image.open('xxx.jpg').convert('RGB')
img = np.array(img) # convert to numpy array
img = img[:, :, ::-1] # convert to BGR
# imageio
import imageio as io
img = io.imread('xxx.jpg')
img = img[:, :, ::-1] # convert to BGR
- Detect
# img: numpy.ndarray, shape=(H, W, 3), dtype=uint8, BGR
# conf_thresh: float, confidence threshold, default=0.5, range=[0.0, 0.1]
from yuface import detect
confs, bboxes, landmarks = detect(img, conf_thresh=0.5)
- Deal result
# confs: numpy.ndarray, shape=(N,), dtype=uint16, confidence
# bboxes: numpy.ndarray, shape=(N, 4), dtype=uint16, bounding box (XYWH)
# landmarks: numpy.ndarray, shape=(N, 10), dtype=uint16, landmarks (XYXYXYXYXY)
import cv2
for conf, bbox, landmark in zip(confs, bboxes, landmarks):
cv2.rectangle(img, (bbox[0], bbox[1]), (bbox[0] + bbox[2], bbox[1] + bbox[3]), (0, 255, 0), 1)
cv2.putText(img, str(conf), (bbox[0], bbox[1]), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 1)
for i in range(5):
cv2.circle(img, (landmark[2*i], landmark[2*i+1]), 2, (0, 255, 0), 1)
cv2.imwrite('result.jpg', img)
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 Distributions
Built Distributions
File details
Details for the file yuface-2023.5.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 230.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a46fcfdf2dba05d20389a6ebd7e6ec8ad471da156223cec2949622b70b0f1f9d |
|
MD5 | 2ea78a4d1a4f4aa5e1a98a4d9831825b |
|
BLAKE2b-256 | 434de3320959754001daf5b5d9e21a68f3319fc3852004947d84512ed596f7af |
File details
Details for the file yuface-2023.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 474.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd03270a672da75b89809a2c999d5728ef19c6e701408a4d0bc9c00480c864a0 |
|
MD5 | 4e9d7d98346300ebac668c3ab30e41df |
|
BLAKE2b-256 | 7034960d8baff630be8edb74a9708acb73e892ae414fd70cc36aeb67b7a57ca1 |
File details
Details for the file yuface-2023.5.1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 230.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82a906517729933f94d1fb18e249c37662f16ffd14430debb7690d18815e4edc |
|
MD5 | 955fd97ca37f7f241c67a89bdff9f77b |
|
BLAKE2b-256 | 7a5f9dc7e1f97b3b0f712a6e84d44f1f7aa6d47dcc20ae9dea206965558347b1 |
File details
Details for the file yuface-2023.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 474.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a07a54b386220fbf7c56bb15c5e1a03c359c93d07c1a6d247cb788d340ed5b50 |
|
MD5 | 9ee0325bad13c4aa6cf094bc73fbf681 |
|
BLAKE2b-256 | e00279fd375411290d9ce901feadaeff74b842b38808108c4f78efb57f2029ca |
File details
Details for the file yuface-2023.5.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 230.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3574fcc9f01d3098031e717a17f5f0782f3146b32c0cd1cd1f5ee32c27c713ce |
|
MD5 | 3ec5ee3cbd61521e3753e239ec5155c6 |
|
BLAKE2b-256 | 71b42139283abb875a69e3104a6246a7a44092b25196972d911fe7ad41f1bd1f |
File details
Details for the file yuface-2023.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 474.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1f30ccb2c9696a3708f6ce95491f13ab06a1da9cff80911aaade94769180f4 |
|
MD5 | 8226d630b292a5fe9a163770fd40d8d0 |
|
BLAKE2b-256 | 92db6b5f65a730502035eb0ee5b220f1518dd1a18f1aa71acac5d2960a93e479 |
File details
Details for the file yuface-2023.5.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 230.5 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 688f14486a432d023c18b5f197771ad0fa34c53e8f08d8cc57e06bb6cba32e0f |
|
MD5 | 2a00be8f9310b0dcc703b8487c18c42f |
|
BLAKE2b-256 | 8509bbc2cd1ffb807e052a8da0b007358194694d4cf7120e3011afe7c8bdd99c |
File details
Details for the file yuface-2023.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 474.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d27addd55cf5077e7470fe344880803098cb434450264ad5f47ce9709464d92 |
|
MD5 | 841268ebb8459834180e09d2454837a9 |
|
BLAKE2b-256 | 136c5fa79874439d6df7e0d3b9634e1477c6098bed3269118cd8e82c2060afce |
File details
Details for the file yuface-2023.5.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 230.9 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5e5de9802a6726c8f93be7778958d4ae1e2c107af83990e8228eb829f9971d9 |
|
MD5 | d3cdbcdc02f128f8bdace7d7deef2d12 |
|
BLAKE2b-256 | bfd9b7f6d5f8f6db67026a39354999a8371cf69553762307d3c36f489c812c77 |
File details
Details for the file yuface-2023.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 475.2 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078a1b1344dc247004b4438185ac6c5de363ff8609dda280ce2ccf082c567d24 |
|
MD5 | 7042504ccf52edca4265876ba5a346d6 |
|
BLAKE2b-256 | f93609e673f92422ce4936f84d098eaa26d0c1633349328d56aa0e8e77d14ea9 |
File details
Details for the file yuface-2023.5.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 231.1 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d56eee26007485f523ca74dba58f7984e1daa23981f7338f04d05eefa87424dc |
|
MD5 | 68e5f3f1c4d01942a4318e04d5f580ea |
|
BLAKE2b-256 | 3b20df4f1bf47d0857eb20106f5dd25b84ab34f7157f3da94b515bca6a12761a |
File details
Details for the file yuface-2023.5.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: yuface-2023.5.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 475.2 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8b0c021988d04876848454fdf2767a6d3d5c1d24b30c1b92176b5ccfcb91895 |
|
MD5 | b4756ac1cd05f67e1329d7d547a2f1f1 |
|
BLAKE2b-256 | c9cad990419c8365fe45f95abf97875f1dae9ad89f6fb6cfc9b80b5c479bed7c |