Skip to main content

A library for face detection using YOLOv8

Project description

Face Detection Library

Build Status License PyPI Version

A Python library for face detection using YOLOv8. This library enables real-time face detection via webcam, leveraging the YOLOv8 model for high-performance object detection.

Features

  • Real-time face detection with YOLOv8
  • Easy integration with webcam
  • Customizable detection thresholds and labels

Installation

You can install the library via pip. Run the following command in your terminal:

pip install face_detection_lib

Usage

To use the face_detection_lib library for face detection, follow these steps:

Basic Usage

from face_detection_lib.detector import FaceDetector

# Initialize the FaceDetector
detector = FaceDetector()

# Start the webcam and run face detection
detector.run_webcam()

Custom Configuration

You can customize the face detection by passing parameters to the FaceDetector class. For example, you can set a custom model path, labels, or confidence threshold:

from face_detection_lib.detector import FaceDetector

# Define custom parameters
custom_model_path = 'path/to/your/custom/model.pt'
custom_labels = {0: 'Person A', 1: 'Person B'}
custom_confidence_threshold = 0.7

# Initialize the FaceDetector with custom parameters
detector = FaceDetector(
    model_path=custom_model_path,
    labels=custom_labels,
    confidence_threshold=custom_confidence_threshold
)

# Start the webcam with custom settings
detector.run_webcam()

Testing

Ensure that your library functions as expected by writing tests in the tests/test_detector.py file. Here's a basic example of how you might start testing:

def test_face_detection():
    # Initialize the FaceDetector
    detector = FaceDetector()
    
    # Add tests to verify the functionality
    assert detector is not None
    # Further tests can be added here

Running Tests

To run your tests, execute:

pytest

Build and Upload to PyPI

To publish your library to PyPI, follow these steps:

  1. Install Twine

    Make sure twine is installed:

    pip install twine
    
  2. Build the Package

    Navigate to the root directory of your project and build the package:

    python setup.py sdist bdist_wheel
    
  3. Upload to PyPI

    Use twine to upload your package to PyPI:

    twine upload dist/*
    

    Replace dist/* with the actual path to your distribution files if necessary.

Contributing

Contributions are welcome! If you have suggestions or improvements, please submit a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or support, please reach out to your.email@example.com.


Thank you for using face_detection_lib!



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

face_detection_lib-0.2.tar.gz (5.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

face_detection_lib-0.2-py3-none-any.whl (5.7 MB view details)

Uploaded Python 3

File details

Details for the file face_detection_lib-0.2.tar.gz.

File metadata

  • Download URL: face_detection_lib-0.2.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for face_detection_lib-0.2.tar.gz
Algorithm Hash digest
SHA256 f1b67590cea7816919c483ff916e820a6aee18cf04e21ab2df2ae8e45c79a5eb
MD5 49ccb9b16e34ad8d41b637327059ac2f
BLAKE2b-256 3066ec14c79c960c8544156c068ec7d6f617284ba5a52b9db32adba6d08b3ea4

See more details on using hashes here.

File details

Details for the file face_detection_lib-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for face_detection_lib-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97bb96708f7b1af73c477566fb61748eadfc6556cf588ccea2a75cd9c0f565ba
MD5 888f61fc244b329b566e02851ef94ca1
BLAKE2b-256 961e1d249e174ac121f836424e89ef6218ba6e8733fc542b57344f183cc000ac

See more details on using hashes here.

Supported by

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