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", device=-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)
  • device: Specify device cpu, cuda, mps or integer for the number of cuda device.
  • 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", device=-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.8.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: yolo5face-0.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 59922d607a56a145a9199c30257436c65ebffe33ac3c91fbece6f5fee10c3cb7
MD5 42ca7fe27dba52fcf01fc1f3a67c59d1
BLAKE2b-256 faf6530021f96db72bb2707a3dd884f8dc5f6db00932089db8d9b4cc4abb8db4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yolo5face-0.0.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 305ca9aeca86deb18c3b667b0a0d9402d3c373dcc987a33e521a4efc8b32f80d
MD5 5cea92dfd35f9b7149f1acce9e94d633
BLAKE2b-256 7de357921fa44f10e3baff8173a10d36a502820d08ceb987f31b149e1edf6345

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