Skip to main content

Wrapper over Yolo5Face for a more convenient inference.

Project description

Wrapper over YoloV5Face

A Python wrapper for the YoloV5Face model, providing easy-to-use functionalities for face detection in images.

Installation

Install the YoloV5Face wrapper using pip:

pip install -U yolo5face

Inference

Use the wrapper to quickly deploy face detection in your projects:

from yolo5face.get_model import get_model
import cv2

model = get_model("yolov5n", gpu=-1, target_size=512, min_face=24)

image = cv2.imread(<IMAGE_PATH>)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

boxes, key_points, scores = model(image)
  • gpu: Specify the GPU number, -1 or cpu for CPU usage.
  • target_size: The minimum size of the target image for detection.
  • min_face: The minimum face size in pixels. Faces smaller than this value will be ignored.

Enhanced Detection with Aggregated Target Sizes

In addition to standard detection, this wrapper supports enhanced detection capabilities by aggregating results over multiple target sizes. This feature is especially useful in scenarios where face sizes vary significantly within the same image.

To use this feature:

from yolo5face.get_model import get_model

model = get_model("yolov5n", gpu=-1, target_size=[320, 640, 1280], min_face=24)

# Aggregate detections over the specified target sizes
boxes, key_points, scores = aggregator(image)

This approach leverages multiple detections at different scales, followed by Non-Maximum Suppression, to provide a more comprehensive set of detections.

License

This YoloV5Face wrapper is released under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yolo5face-0.0.6.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

yolo5face-0.0.6-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file yolo5face-0.0.6.tar.gz.

File metadata

  • Download URL: yolo5face-0.0.6.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for yolo5face-0.0.6.tar.gz
Algorithm Hash digest
SHA256 7eded63c376e0715a05ba34cba9e6e7a52d55b30fda91f78ba7c9ae146b0f928
MD5 567df95c186ded81a3dee9df9af6e2f1
BLAKE2b-256 455d6604e281a6ba29bbbcfc2facb7332c943140e29dd1e39bb769e40c589927

See more details on using hashes here.

File details

Details for the file yolo5face-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: yolo5face-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for yolo5face-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bf53c56b89d731b4c484751ccc29d6301e478f002bcdcff805ce7c974cb19ca6
MD5 00892c0f61770f56933d5a1ae537f12a
BLAKE2b-256 a79d7a311abb8f2bcb9e1e47010004bc723c4bc34573b1405039107d4e419f8a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page