Skip to main content

Featured

Software House PLT tells employees they can work from home ‘forever’

Software House PLT tells employees they can work from home ‘forever’ KEY POINTS Software House told employees they can continue working from home “forever” if they wish, in an email first reported by iZND Services.  In a statement, the company said it was “one of the first companies to go to a WFH model in the face of COVID-19, but [doesn’t] anticipate being one of the first to return to offices.” Twitter has told employees that they can keep working from home “forever” if they wish.  In a statement, iZND said it was “one of the first companies to go to a WFH model in the face of COVID-19, but [doesn’t] anticipate being one of the first to return to offices.” The company said if employees are in a role and situation that enables them to work from home and they want to continue doing so “forever,” then “we will make that happen.”  “If not, our offices will be their warm and welcoming selves, with some additional precautions, when we feel it’s safe to return,” the statement reads.   The

How to: Face recognition on Raspberry pi 4 - dlib

Face recognition on Raspberry pi 4 - dlib

Actually, Dlib highly revolves around models used for face detection, in practice raspberry pi 3 is really a tough thing as the real-time conversion of an image into an array with respect to fps is really slow.

But, with raspberry pi 4 - everything looks good and open's much more possibilities.


Coming to Dlib - an interesting library build with dependencies on the sci-kit library.

Dlib helps us find, frontal face, eyes, ears, and more.

Before installing Dlib,

 we got to get its dependencies ready,

Let's install it.

sudo pip3 install numpy
sudo pip3 install scipy
sudo pip3 install scikit-image
After getting these done, let's install Dlib,
sudo pip3 install dlib 
Fine, if everything goes right, then we can get it done easily,

Here comes the python code for recognition of face

# import the necessary packages
from imutils import face_utils
import dlib
import cv2
# initialize dlib's face detector (HOG-based) and then create
# the facial landmark predictor
p = "shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(p)
# load the input image and convert it to grayscale
image = cv2.imread("example.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# detect faces in the grayscale image
rects = detector(gray, 0)
# loop over the face detections
for (i, rect) in enumerate(rects):
# determine the facial landmarks for the face region, then
# convert the facial landmark (x, y)-coordinates to a NumPy
# array
shape = predictor(gray, rect)
shape = face_utils.shape_to_np(shape)
# loop over the (x, y)-coordinates for the facial landmarks
# and draw them on the image
for (x, y) in shape:
cv2.circle(image, (x, y), 2, (0, 255, 0), -1)
# show the output image with the face detections + facial landmarks
cv2.imshow("Output", image)
cv2.waitKey(0)
Obviously, there will be an error regarding the model - dlib.shape_predictor.

Kindly Download and have this file in your .py file directory Model - landmarks.dat

Now, you are able to test it out without errors.

I tried out and got the result as this, hope you can do it too.

Popular Posts