Spaces:
Runtime error
Runtime error
from face_recognition import hog as faces_detect | |
import cv2 | |
from image_processing_operations import resize_image | |
def face_rec_reshape(img): | |
Liste_de_visages = [] | |
faces = faces_detect(img) | |
for (x, y, w, h) in faces: | |
crop_img = img[y:y+h, x:x+w] | |
image_finale = resize_image(crop_img,224,224) | |
Liste_de_visages.append(image_finale) | |
return Liste_de_visages | |
if __name__ == "__main__" : | |
url = "./Data/Abbi.jpg" | |
Img = cv2.imread(url, 1) | |
img = face_rec_reshape(Img) | |
for imgf in img : | |
cv2.imshow('img', imgf) | |
cv2.waitKey() | |
cv2.destroyWindow() | |