Face Detection Library
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
Contributing
Contributions are welcome! If you have suggestions or improvements, please submit a pull request or open an issue.
Contributors
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using face_detection_lib!
Metadata
Release files for face-detection-lib 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| face_detection_lib-0.8.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| face_detection_lib-0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / face_detection_lib-0.8.tar.gz
| Download URL | face_detection_lib-0.8.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8334551f3548a3ff9d26a08906b512beb97b1769565937fa10b40e3be8b9907d
|
|
BLAKE2b-256 checksum How to use checksums |
cc81576a04227947edfa83769c6a7b9aa6153844f1f5f7bda35f5d751af8d658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|
Release files / face_detection_lib-0.8-py3-none-any.whl
| Download URL | face_detection_lib-0.8-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62923a5875946912053bf43a4b0d171c9fce379334bcd249b5662c290a55d352
|
|
BLAKE2b-256 checksum How to use checksums |
b4406ea2b81ecb68c6f89157579c5113f193912c6543ac7f21177d0dfeecb75b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.19
|