Skip to main content

Wrapper over YoloV5Face

A user-friendly Python wrapper for the YoloV5Face model, designed to simplify face detection in images. This wrapper offers straightforward functionalities for quick integration into Python projects, along with customization options for handling various face detection scenarios.

Installation

Install the YoloV5Face wrapper using pip to easily incorporate it into your projects:

pip install -U yolo5face

Face Detection: Standard and Enhanced

The YoloV5Face wrapper supports both standard and enhanced face detection. The standard detection is suitable for most use cases, while the enhanced detection, which aggregates results over multiple target sizes, is ideal for images with faces of varying sizes.

Getting Started

To detect faces in an image:

from yolo5face.get_model import get_model
import cv2

# Initialize the model
model = get_model("yolov5n", device=-1, min_face=24)

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

# Standard Detection
boxes, key_points, scores = model(image, target_size=512)

# Enhanced Detection (aggregating over multiple target sizes)
enhanced_boxes, enhanced_key_points, enhanced_scores = model(image, target_size=[320, 640, 1280])

Parameters:

  • device: Set the processing device (cpu, cuda, mps, or CUDA device number).
  • target_size: For standard detection, it's the minimum size of the target image. For enhanced detection, provide a list of sizes for better accuracy.
  • min_face: Minimum size of faces to detect in pixels. Smaller faces will be ignored.

This approach, especially the enhanced detection, uses multiple scales for improved accuracy and is followed by Non-Maximum Suppression to refine the results.

License

This YoloV5Face wrapper is released under the MIT License.

Metadata

Release files for yolo5face 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yolo5face 0.0.10
File Size Uploaded
yolo5face-0.0.10.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yolo5face 0.0.10
File Interpreter ABI Platform
yolo5face-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 35.2 kB

Release files / yolo5face-0.0.10.tar.gz

Download URL yolo5face-0.0.10.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0c830efe6196c6e0dd49e8393e28c2284e0bd49b517cc23d6843b2674f1a4d08
BLAKE2b-256 checksum
How to use checksums
3efe26e3a63f0e7ad4914b5ac1692374f899427a063c133a1d31d7f9c194f977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / yolo5face-0.0.10-py3-none-any.whl

Download URL yolo5face-0.0.10-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcf7146e404a8d22437dd6cffbe72ce3048b027d986c93b7c8109227109bef79
BLAKE2b-256 checksum
How to use checksums
026a008fba082967442eba466a240f23d3252633d5ef32a04b916fc97ffd9ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page