Skip to content

Commit

Permalink
removed face-recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrock94 committed Sep 13, 2024
1 parent 5cfdacc commit 2a82362
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 40 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ In order to work correctly, pyaesthetics requires the installation of the follow
- imutils
- pytesseract
- pillow
- face-recognition
- scikit-image

## Contacts
Expand Down
Binary file modified pyaesthetics/__pycache__/analysis.cpython-310.pyc
Binary file not shown.
37 changes: 0 additions & 37 deletions pyaesthetics/facedetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import cv2
import matplotlib.pyplot as plt
import numpy as np
import face_recognition
from PIL import Image

###############################################################################
Expand Down Expand Up @@ -54,39 +53,6 @@ def detect_faces_cv2(img, plot=False):
# Return the list of detected faces
return faces

# TODO: Wait for patch
# def detect_faces(imgpath, plot=False, model='hog'):
# """ This function uses face-recognition to detect faces in a picture.
# By default it uses the hog method. cnn method can be passed as model parameter.

# :param img: path to the image to analyze
# :type img: string
# :param plot: whether to plot or not the results
# :type plot: bool
# :param model: which model to use for the detection of faces (hog or cnn). Default is 'hog'.
# :type model: string
# :return: list of detected faces as rectangles
# :rtype: list
# """

# # Convert the image to grayscale as Haar cascades work better on grayscale images
# image = face_recognition.load_image_file(imgpath)
# faces = face_recognition.face_locations(image, model=model)
# # If plot is True, draw rectangles around detected faces and display the image
# if plot:
# for top, right, bottom, left in faces:
# cv2.rectangle(image, (left, top), (right, bottom), (255, 0, 0), 2)
# plt.imshow(image)

# # if plot:
# # for top, right, bottom, left in faces:
# # # You can access the actual face itself like this:
# # face_image = image[top:bottom, left:right]
# # pil_image = Image.fromarray(face_image)
# # pil_image.show()

# # Return the list of detected faces
# return faces

###############################################################################
# #
Expand Down Expand Up @@ -115,9 +81,6 @@ def detect_faces_cv2(img, plot=False):

# Print the number of faces detected
print("Number of faces in the picture is:", len(faces))

# Detect faces in the image and plot the results
# faces = detect_faces(sample_img, plot=True)

# Print the number of faces detected
print("Number of faces in the picture is:", len(faces))
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pandas = "^2.2"
opencv-python = "^4.10"
pytesseract = "^0.3"
pillow = "^10.4"
face-recognition = "^1.3"
scikit-image = "^0.24"
tqdm = "^4.66"
rembg = "^2.0.59"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pandas>=2.2
opencv-python>=4.10
pytesseract>=0.3
pillow>=10.4
face-recognition>=1.3
scikit-image>=0.24
tqdm>=4.66
rembg>=2.0.59

0 comments on commit 2a82362

Please sign in to comment.