Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
It is a package having pre-built codes of face detection. You can implement with just single line of code.
faceDetector(image, draw=False)
image
(a single frame) as input and a variable draw
with default value False. You can change the value of parameter draw
to True if you want to draw the rectangular box over the face on the image
frame.frame
and a list of [x,y,w,h]
. x
is the minimum x co-ordinates of the face, y
is the minimum y co-ordinate of face, w
is the width and h
is the height of the face. NOTE that the frame
will have rectangular box over the face if value of draw
is set to True in the function.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()
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
FAQs
Detect faces using ML models just with few lines of code
We found that lkfacedetection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.