face-detection

Face detection using Cascade Classifier in opencv python

Deadly 提交于 2020-04-06 03:10:03
问题 I am using the inbuilt cascade classifier for the face detection. This is how the code is (OpenCV Python Tutorials): import numpy as np import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') img = cv2.imread('ammma.jpg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, 1.3, 5) for (x,y,w,h) in faces: cv2.Rectangle(img,(x,y),(x+w,y+h),(255,0,0),2) roi_gray = gray[y

Face detection using Cascade Classifier in opencv python

妖精的绣舞 提交于 2020-04-06 03:04:25
问题 I am using the inbuilt cascade classifier for the face detection. This is how the code is (OpenCV Python Tutorials): import numpy as np import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') img = cv2.imread('ammma.jpg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, 1.3, 5) for (x,y,w,h) in faces: cv2.Rectangle(img,(x,y),(x+w,y+h),(255,0,0),2) roi_gray = gray[y

Can Google Cloud Vision API label faces?

回眸只為那壹抹淺笑 提交于 2020-03-26 04:29:11
问题 I am currently using google cloud-vision api for a project. I want to assign a unique ID to a face, so that it automatically detects which IDs any image contains. This way I can know which person is in the image. Can cloud-vision distinguish faces and return some unique ID for a face? 回答1: NO , and as Armin has already mentioned, Google Vision API doesn't support Facial Recognition or Face verification. It only performs face detection on an image. What you can actually do is to use tensorflow

TypeError: stat: path should be string, bytes, os.PathLike or integer, not cv2.VideoCapture ,detect using neural network using mtcnn?

蹲街弑〆低调 提交于 2020-03-05 02:58:47
问题 i've tried to detect faces from my webcam , but it was only detect the first face which appeared in the first frame , then it will crush , i have used mtcnn to detection operation import cv2 i = 0 capture = cv2.VideoCapture(0) while(True): ret, frame = capture.read() frames_tracked = [] print('\rTracking frame: {}'.format(i + 1), end='') frame_pil = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) frame_pil = Image.fromarray(frame_pil) boxes,_ = mtcnn.detect(frame_pil) frame_draw = frame_pil.copy() draw

TypeError: stat: path should be string, bytes, os.PathLike or integer, not cv2.VideoCapture ,detect using neural network using mtcnn?

浪尽此生 提交于 2020-03-05 02:52:06
问题 i've tried to detect faces from my webcam , but it was only detect the first face which appeared in the first frame , then it will crush , i have used mtcnn to detection operation import cv2 i = 0 capture = cv2.VideoCapture(0) while(True): ret, frame = capture.read() frames_tracked = [] print('\rTracking frame: {}'.format(i + 1), end='') frame_pil = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) frame_pil = Image.fromarray(frame_pil) boxes,_ = mtcnn.detect(frame_pil) frame_draw = frame_pil.copy() draw

Vision API Cropping Face Landmark

别说谁变了你拦得住时间么 提交于 2020-03-03 12:30:23
问题 I'm trying to outline the whole image with a path so I could crop it out, but the path is not following the face's outline. Here's my code : for (Landmark landmark : face.getLandmarks()) { if (face.getLandmarks().indexOf(landmark) == 0) { path.moveTo(landmark.getPosition().x, landmark.getPosition().y); } else { path.lineTo(landmark.getPosition().x, landmark.getPosition().y); } } How do I make it so that the path only follows the outer outline of the face 回答1: Look at the Type of each landmark

Face Detector Mobile Vision speed not increased with smaller Bitmap

让人想犯罪 __ 提交于 2020-01-25 06:51:12
问题 Summary: Our app depends on a high detection speed of facial landmarks (= like eyes open or closed). Thus I developed an algorythm that takes the position of the face from the last frame and crops the image from the next frame. This works perfectly and the Face Detector only has to process a quarter of the image. But it does not increase the detection speed. Does anybody know why? Edit: All that my algorythm is doing is croping the image based on the information from the last image. But it

face alignment algorithm on images

大兔子大兔子 提交于 2020-01-22 14:52:08
问题 How can I do a basic face alignment on a 2-dimensional image with the assumption that I have the position/coordinates of the mouth and eyes. Is there any algorithm that I could implement to correct the face alignment on images? 回答1: Face (or image) alignment refers to aligning one image (or face in your case) with respect to another (or a reference image/face). It is also referred to as image registration. You can do that using either appearance ( intensity-based registration ) or key-point

how to notify user if there are common faces detected between two directories with python and opencv

巧了我就是萌 提交于 2020-01-14 05:31:26
问题 Firstly, I am sorry if the title is long. I am working on face detection using python. I am trying to write a script where it will notify user when there is same picture or almost same picture/faces detected between two directories/folder. Below is the script that I wrote so far. import cv2 import glob, requests def detect1(): face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml') for img in glob.glob('/Users/Ling/Pythonfiles/Faces/*.jpg'): cv_img = cv2.imread(img) gray = cv2

Android Face Detection API - Stored video file

人走茶凉 提交于 2020-01-13 05:11:25
问题 I would like to perform face detection / tracking on a video file (e.g. an MP4 from the users gallery) using the Android Vision FaceDetector API. I can see many examples on using the CameraSource class to perform face tracking on the stream coming directly from the camera (e.g. on the android-vision github), but nothing on video files. I tried looking at the source code for CameraSource through Android Studio, but it is obfuscated, and I couldn't see the original online. I image there are