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.7.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

yolo5face-0.0.7-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yolo5face-0.0.7.tar.gz
  • Upload date:
  • Size: 16.4 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.7.tar.gz
Algorithm Hash digest
SHA256 4900ff4cd803f3148622cef084dc3359b09b0dfb22a2853e200e289c3a1c2a21
MD5 ff3bc63301132ed7b526966ecce401d8
BLAKE2b-256 6bead95cf009a444e687153d437950a5f8f1b4323a61c7e1d138d2bd4bcd9cbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yolo5face-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 16.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 87028511692eae60a392cb8c541e1587a31ac38fc90c7a72d389cc3bcc50c38a
MD5 9c553491947df684e0d3de4b9f9fc7a4
BLAKE2b-256 07ec3c9e751e345c8db8493d7d13c245d51b51a1f97ca6582c3b51d2dbb1803c

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