Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freearhey/facedetector
Python script for detecting faces in an image
https://github.com/freearhey/facedetector
Last synced: about 1 month ago
JSON representation
Python script for detecting faces in an image
- Host: GitHub
- URL: https://github.com/freearhey/facedetector
- Owner: freearhey
- License: mit
- Created: 2023-08-01T20:44:53.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-02T23:24:13.000Z (over 1 year ago)
- Last Synced: 2024-10-10T15:18:25.162Z (about 1 month ago)
- Language: Python
- Size: 533 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FaceDetector
Python script for detecting faces in an image.
## Installation
```sh
pip install facedetector-py
```## Usage
```py
from facedetector import FaceDetectorimg = 'path/to/image.jpg' # or NumPy array
faces = FaceDetector.detect(img)print(faces)
```Output:
```py
[
{
'score': 0.9990496039390564,
'angle': -5.194428907734846,
'pivot': (1960, 819),
'coordinates': [(1920, 782), (1993, 775), (1999, 848), (1927, 855)],
'bounding_box': {
'x': 1920,
'y': 775,
'width': 79,
'height': 80
},
'landmarks': {
'right_eye': (1949.1595, 809.30695),
'left_eye': (1970.3654, 808.0268),
'nose': (1963.1459, 819.6671),
'mouth_right': (1953.5267, 830.48206),
'mouth_left': (1968.4865, 829.6616),
'eyes_center': (1959, 808),
'mouth_center': (1961, 830),
'face_center': (1960, 819)
}
},
...
]
```## Test
```sh
pytest tests/
```## License
[MIT](LICENSE)