About
It is a package having pre-built codes of face detection. You can implement with just single line of code.
Function
faceDetector(image, draw=False)
- Function Parameter : This function takes
image(a single frame) as input and a variabledrawwith default value False. You can change the value of parameterdrawto True if you want to draw the rectangular box over the face on theimageframe. - Output : This function returns a nested list of length 2. The element at index 1 is the
frameand a list of[x,y,w,h].xis the minimum x co-ordinates of the face,yis the minimum y co-ordinate of face,wis the width andhis the height of the face. NOTE that theframewill have rectangular box over the face if value ofdrawis set to True in the function.
Usage
faceDetector(image, draw=False)
With detection over the face directly through function
from lkfacedetection import faceDetector
import cv2
cap = cv2.VideoCapture(0)
while True:
success, image = cap.read()
functionValues = faceDetector(image,draw=True) #draw over the frame from function
frame = functionValues[0]
cv2.imshow('Face', frame)
cv2.waitKey(1)
cap.release()
With detection externally using the values from function
from lkfacedetection import faceDetector
import cv2
cap = cv2.VideoCapture(0)
while True:
success, image = cap.read()
functionValues = faceDetector(image) #doesn't draw over the frame
frame = functionValues[0]
x,y,w,h = functionValues[1]
cv2.rectangle(frame, (x, y), (x + w, y + h), (255, 0, 0), 2) #Draws a rectangle over the face
cv2.imshow('Face', frame)
cv2.waitKey(1)
cap.release()
Developer
This package is developed by Lakshay Kumar an enthusiastic AI Researcher. This is developed keeping in mind the pain to write lengthy lines of code just to detect faces. This will enable other developers to focus more on implementation part rather than spending time on coding the face detection module.
Feel free to share your feedback via mail
Release files for lkfacedetection 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lkfacedetection-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / lkfacedetection-0.0.1-py3-none-any.whl
| Download URL | lkfacedetection-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a4394f74d1e06edc0a538cd79a680ffba1e3ba07c60812fc96fa2c6c9affa6f
|
|
BLAKE2b-256 checksum How to use checksums |
9d70f0917460adf0fd8b5b3527c0ef7a71deb3728ecaff6bf1d05aa2f2b2ce17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.2
|