# Face Detection Library

[](https://opensource.org/licenses/MIT)

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:
```bash
pip install face_detection_lib
```
## Usage
To use the `face_detection_lib` library for face detection, follow these steps:
### Basic Usage
```python
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:
```python
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:
```python
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:
```bash
pytest
```
## Contributing
Contributions are welcome! If you have suggestions or improvements, please submit a pull request or open an issue.
### Contributors
- [Sehastrajit](https://github.com/Sehastrajit)
- [Deena](https://github.com/Deena1412)
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
Thank you for using `face_detection_lib`!
Raw data
{
"_id": null,
"home_page": "https://github.com/Sehastrajit/face-access-detection",
"name": "face-detection-lib",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Sehastrajit",
"author_email": "your.email@example.com",
"download_url": "https://files.pythonhosted.org/packages/cc/81/576a04227947edfa83769c6a7b9aa6153844f1f5f7bda35f5d751af8d658/face_detection_lib-0.8.tar.gz",
"platform": null,
"description": "\n# Face Detection Library\n\n\n[](https://opensource.org/licenses/MIT)\n\n\nA 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.\n\n## Features\n\n- Real-time face detection with YOLOv8\n- Easy integration with webcam\n- Customizable detection thresholds and labels\n\n## Installation\n\nYou can install the library via pip. Run the following command in your terminal:\n\n```bash\npip install face_detection_lib\n```\n\n## Usage\n\nTo use the `face_detection_lib` library for face detection, follow these steps:\n\n### Basic Usage\n\n```python\nfrom face_detection_lib.detector import FaceDetector\n\n# Initialize the FaceDetector\ndetector = FaceDetector()\n\n# Start the webcam and run face detection\ndetector.run_webcam()\n```\n\n### Custom Configuration\n\nYou 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:\n\n```python\nfrom face_detection_lib.detector import FaceDetector\n\n# Define custom parameters\ncustom_model_path = 'path/to/your/custom/model.pt'\ncustom_labels = {0: 'Person A', 1: 'Person B'}\ncustom_confidence_threshold = 0.7\n\n# Initialize the FaceDetector with custom parameters\ndetector = FaceDetector(\n model_path=custom_model_path,\n labels=custom_labels,\n confidence_threshold=custom_confidence_threshold\n)\n\n# Start the webcam with custom settings\ndetector.run_webcam()\n```\n\n## Testing\n\nEnsure 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:\n\n```python\ndef test_face_detection():\n # Initialize the FaceDetector\n detector = FaceDetector()\n \n # Add tests to verify the functionality\n assert detector is not None\n # Further tests can be added here\n```\n\n### Running Tests\n\nTo run your tests, execute:\n\n```bash\npytest\n```\n\n## Contributing\n\nContributions are welcome! If you have suggestions or improvements, please submit a pull request or open an issue.\n\n### Contributors\n- [Sehastrajit](https://github.com/Sehastrajit)\n- [Deena](https://github.com/Deena1412)\n\n\n\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\nThank you for using `face_detection_lib`!\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library for face detection using YOLOv8",
"version": "0.8",
"project_urls": {
"Homepage": "https://github.com/Sehastrajit/face-access-detection"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b4406ea2b81ecb68c6f89157579c5113f193912c6543ac7f21177d0dfeecb75b",
"md5": "e4eecaa765051e2cb0a516e7b195f229",
"sha256": "62923a5875946912053bf43a4b0d171c9fce379334bcd249b5662c290a55d352"
},
"downloads": -1,
"filename": "face_detection_lib-0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e4eecaa765051e2cb0a516e7b195f229",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4659,
"upload_time": "2024-08-24T16:05:21",
"upload_time_iso_8601": "2024-08-24T16:05:21.549150Z",
"url": "https://files.pythonhosted.org/packages/b4/40/6ea2b81ecb68c6f89157579c5113f193912c6543ac7f21177d0dfeecb75b/face_detection_lib-0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc81576a04227947edfa83769c6a7b9aa6153844f1f5f7bda35f5d751af8d658",
"md5": "de976132810bf6a8d05e9c652eaa8313",
"sha256": "8334551f3548a3ff9d26a08906b512beb97b1769565937fa10b40e3be8b9907d"
},
"downloads": -1,
"filename": "face_detection_lib-0.8.tar.gz",
"has_sig": false,
"md5_digest": "de976132810bf6a8d05e9c652eaa8313",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4072,
"upload_time": "2024-08-24T16:05:22",
"upload_time_iso_8601": "2024-08-24T16:05:22.798418Z",
"url": "https://files.pythonhosted.org/packages/cc/81/576a04227947edfa83769c6a7b9aa6153844f1f5f7bda35f5d751af8d658/face_detection_lib-0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-24 16:05:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Sehastrajit",
"github_project": "face-access-detection",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "face-detection-lib"
}