yuface


Nameyuface JSON
Version 2023.5.1 PyPI version JSON
download
home_pagehttps://github.com/ShiqiYu/libfacedetection.pip
SummaryA face detection library based on libfacedetection
upload_time2023-06-04 10:36:45
maintainer
docs_urlNone
authorWwupup
requires_python
license./LISENCE
keywords face detection
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Yuface
[![PyPI](https://img.shields.io/pypi/v/yuface.svg)](https://pypi.python.org/pypi/yuface)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
## Introduction 
A super fast face detector packaged by the [libfacedetection](https://github.com/ShiqiYu/libfacedetection) repository using pybind11.
## Change Log
[2023-5-8] Project init.

## Quick start
```shell
pip install yuface
```

### Usage
1. Load image
```python
# 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
```
2. Detect
```python
# 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)
```
3. Deal result
```python
# 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)
```
![result](resources/result.jpg)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ShiqiYu/libfacedetection.pip",
    "name": "yuface",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "face detection",
    "author": "Wwupup",
    "author_email": "12032501@mail.sustech.edu.cn",
    "download_url": "",
    "platform": null,
    "description": "# Yuface\n[![PyPI](https://img.shields.io/pypi/v/yuface.svg)](https://pypi.python.org/pypi/yuface)\n[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)\n## Introduction \nA super fast face detector packaged by the [libfacedetection](https://github.com/ShiqiYu/libfacedetection) repository using pybind11.\n## Change Log\n[2023-5-8] Project init.\n\n## Quick start\n```shell\npip install yuface\n```\n\n### Usage\n1. Load image\n```python\n# opencv\nimport cv2\nimg = cv2.imread('xxx.jpg')\n\n# PIL\nimport PIL\nimport numpy as np\nimg = PIL.Image.open('xxx.jpg').convert('RGB')\nimg = np.array(img)                             # convert to numpy array\nimg = img[:, :, ::-1]                           # convert to BGR\n\n# imageio\nimport imageio as io\nimg = io.imread('xxx.jpg')\nimg = img[:, :, ::-1]                           # convert to BGR\n```\n2. Detect\n```python\n# img: numpy.ndarray, shape=(H, W, 3), dtype=uint8, BGR\n# conf_thresh: float, confidence threshold, default=0.5, range=[0.0, 0.1]\nfrom yuface import detect\nconfs, bboxes, landmarks = detect(img, conf_thresh=0.5)\n```\n3. Deal result\n```python\n# confs: numpy.ndarray, shape=(N,), dtype=uint16, confidence \n# bboxes: numpy.ndarray, shape=(N, 4), dtype=uint16, bounding box (XYWH)\n# landmarks: numpy.ndarray, shape=(N, 10), dtype=uint16, landmarks (XYXYXYXYXY)\nimport cv2\nfor conf, bbox, landmark in zip(confs, bboxes, landmarks):\n    cv2.rectangle(img, (bbox[0], bbox[1]), (bbox[0] + bbox[2], bbox[1] + bbox[3]), (0, 255, 0), 1)\n    cv2.putText(img, str(conf), (bbox[0], bbox[1]), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 1)\n    for i in range(5):\n        cv2.circle(img, (landmark[2*i], landmark[2*i+1]), 2, (0, 255, 0), 1)\ncv2.imwrite('result.jpg', img)\n```\n![result](resources/result.jpg)\n",
    "bugtrack_url": null,
    "license": "./LISENCE",
    "summary": "A face detection library based on libfacedetection",
    "version": "2023.5.1",
    "project_urls": {
        "Homepage": "https://github.com/ShiqiYu/libfacedetection.pip"
    },
    "split_keywords": [
        "face",
        "detection"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e00279fd375411290d9ce901feadaeff74b842b38808108c4f78efb57f2029ca",
                "md5": "9ee0325bad13c4aa6cf094bc73fbf681",
                "sha256": "a07a54b386220fbf7c56bb15c5e1a03c359c93d07c1a6d247cb788d340ed5b50"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "9ee0325bad13c4aa6cf094bc73fbf681",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 474484,
            "upload_time": "2023-06-04T10:36:45",
            "upload_time_iso_8601": "2023-06-04T10:36:45.745139Z",
            "url": "https://files.pythonhosted.org/packages/e0/02/79fd375411290d9ce901feadaeff74b842b38808108c4f78efb57f2029ca/yuface-2023.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a5f9dc7e1f97b3b0f712a6e84d44f1f7aa6d47dcc20ae9dea206965558347b1",
                "md5": "955fd97ca37f7f241c67a89bdff9f77b",
                "sha256": "82a906517729933f94d1fb18e249c37662f16ffd14430debb7690d18815e4edc"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "955fd97ca37f7f241c67a89bdff9f77b",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 230727,
            "upload_time": "2023-06-04T10:36:47",
            "upload_time_iso_8601": "2023-06-04T10:36:47.856164Z",
            "url": "https://files.pythonhosted.org/packages/7a/5f/9dc7e1f97b3b0f712a6e84d44f1f7aa6d47dcc20ae9dea206965558347b1/yuface-2023.5.1-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7034960d8baff630be8edb74a9708acb73e892ae414fd70cc36aeb67b7a57ca1",
                "md5": "4e9d7d98346300ebac668c3ab30e41df",
                "sha256": "fd03270a672da75b89809a2c999d5728ef19c6e701408a4d0bc9c00480c864a0"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4e9d7d98346300ebac668c3ab30e41df",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 474500,
            "upload_time": "2023-06-04T10:36:50",
            "upload_time_iso_8601": "2023-06-04T10:36:50.395693Z",
            "url": "https://files.pythonhosted.org/packages/70/34/960d8baff630be8edb74a9708acb73e892ae414fd70cc36aeb67b7a57ca1/yuface-2023.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "434de3320959754001daf5b5d9e21a68f3319fc3852004947d84512ed596f7af",
                "md5": "2ea78a4d1a4f4aa5e1a98a4d9831825b",
                "sha256": "a46fcfdf2dba05d20389a6ebd7e6ec8ad471da156223cec2949622b70b0f1f9d"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2ea78a4d1a4f4aa5e1a98a4d9831825b",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 230744,
            "upload_time": "2023-06-04T10:36:52",
            "upload_time_iso_8601": "2023-06-04T10:36:52.425976Z",
            "url": "https://files.pythonhosted.org/packages/43/4d/e3320959754001daf5b5d9e21a68f3319fc3852004947d84512ed596f7af/yuface-2023.5.1-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9cad990419c8365fe45f95abf97875f1dae9ad89f6fb6cfc9b80b5c479bed7c",
                "md5": "b4756ac1cd05f67e1329d7d547a2f1f1",
                "sha256": "c8b0c021988d04876848454fdf2767a6d3d5c1d24b30c1b92176b5ccfcb91895"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b4756ac1cd05f67e1329d7d547a2f1f1",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": null,
            "size": 475160,
            "upload_time": "2023-06-04T10:36:54",
            "upload_time_iso_8601": "2023-06-04T10:36:54.091106Z",
            "url": "https://files.pythonhosted.org/packages/c9/ca/d990419c8365fe45f95abf97875f1dae9ad89f6fb6cfc9b80b5c479bed7c/yuface-2023.5.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b20df4f1bf47d0857eb20106f5dd25b84ab34f7157f3da94b515bca6a12761a",
                "md5": "68e5f3f1c4d01942a4318e04d5f580ea",
                "sha256": "d56eee26007485f523ca74dba58f7984e1daa23981f7338f04d05eefa87424dc"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp36-cp36m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "68e5f3f1c4d01942a4318e04d5f580ea",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": null,
            "size": 231102,
            "upload_time": "2023-06-04T10:36:55",
            "upload_time_iso_8601": "2023-06-04T10:36:55.838339Z",
            "url": "https://files.pythonhosted.org/packages/3b/20/df4f1bf47d0857eb20106f5dd25b84ab34f7157f3da94b515bca6a12761a/yuface-2023.5.1-cp36-cp36m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f93609e673f92422ce4936f84d098eaa26d0c1633349328d56aa0e8e77d14ea9",
                "md5": "7042504ccf52edca4265876ba5a346d6",
                "sha256": "078a1b1344dc247004b4438185ac6c5de363ff8609dda280ce2ccf082c567d24"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7042504ccf52edca4265876ba5a346d6",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 475235,
            "upload_time": "2023-06-04T10:36:57",
            "upload_time_iso_8601": "2023-06-04T10:36:57.965011Z",
            "url": "https://files.pythonhosted.org/packages/f9/36/09e673f92422ce4936f84d098eaa26d0c1633349328d56aa0e8e77d14ea9/yuface-2023.5.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfd9b7f6d5f8f6db67026a39354999a8371cf69553762307d3c36f489c812c77",
                "md5": "d3cdbcdc02f128f8bdace7d7deef2d12",
                "sha256": "c5e5de9802a6726c8f93be7778958d4ae1e2c107af83990e8228eb829f9971d9"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "d3cdbcdc02f128f8bdace7d7deef2d12",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 230867,
            "upload_time": "2023-06-04T10:37:00",
            "upload_time_iso_8601": "2023-06-04T10:37:00.115064Z",
            "url": "https://files.pythonhosted.org/packages/bf/d9/b7f6d5f8f6db67026a39354999a8371cf69553762307d3c36f489c812c77/yuface-2023.5.1-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "136c5fa79874439d6df7e0d3b9634e1477c6098bed3269118cd8e82c2060afce",
                "md5": "841268ebb8459834180e09d2454837a9",
                "sha256": "7d27addd55cf5077e7470fe344880803098cb434450264ad5f47ce9709464d92"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "841268ebb8459834180e09d2454837a9",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 474349,
            "upload_time": "2023-06-04T10:37:02",
            "upload_time_iso_8601": "2023-06-04T10:37:02.163747Z",
            "url": "https://files.pythonhosted.org/packages/13/6c/5fa79874439d6df7e0d3b9634e1477c6098bed3269118cd8e82c2060afce/yuface-2023.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8509bbc2cd1ffb807e052a8da0b007358194694d4cf7120e3011afe7c8bdd99c",
                "md5": "2a00be8f9310b0dcc703b8487c18c42f",
                "sha256": "688f14486a432d023c18b5f197771ad0fa34c53e8f08d8cc57e06bb6cba32e0f"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2a00be8f9310b0dcc703b8487c18c42f",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 230545,
            "upload_time": "2023-06-04T10:37:04",
            "upload_time_iso_8601": "2023-06-04T10:37:04.279740Z",
            "url": "https://files.pythonhosted.org/packages/85/09/bbc2cd1ffb807e052a8da0b007358194694d4cf7120e3011afe7c8bdd99c/yuface-2023.5.1-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92db6b5f65a730502035eb0ee5b220f1518dd1a18f1aa71acac5d2960a93e479",
                "md5": "8226d630b292a5fe9a163770fd40d8d0",
                "sha256": "2e1f30ccb2c9696a3708f6ce95491f13ab06a1da9cff80911aaade94769180f4"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "8226d630b292a5fe9a163770fd40d8d0",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 474590,
            "upload_time": "2023-06-04T10:37:06",
            "upload_time_iso_8601": "2023-06-04T10:37:06.193650Z",
            "url": "https://files.pythonhosted.org/packages/92/db/6b5f65a730502035eb0ee5b220f1518dd1a18f1aa71acac5d2960a93e479/yuface-2023.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71b42139283abb875a69e3104a6246a7a44092b25196972d911fe7ad41f1bd1f",
                "md5": "3ec5ee3cbd61521e3753e239ec5155c6",
                "sha256": "3574fcc9f01d3098031e717a17f5f0782f3146b32c0cd1cd1f5ee32c27c713ce"
            },
            "downloads": -1,
            "filename": "yuface-2023.5.1-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "3ec5ee3cbd61521e3753e239ec5155c6",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 230490,
            "upload_time": "2023-06-04T10:37:07",
            "upload_time_iso_8601": "2023-06-04T10:37:07.806912Z",
            "url": "https://files.pythonhosted.org/packages/71/b4/2139283abb875a69e3104a6246a7a44092b25196972d911fe7ad41f1bd1f/yuface-2023.5.1-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-04 10:36:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ShiqiYu",
    "github_project": "libfacedetection.pip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "yuface"
}
        
Elapsed time: 0.22319s