RajaThor commited on
Commit
8ec329c
·
verified ·
1 Parent(s): d8b7617

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -99,10 +99,8 @@ def detect_and_align_faces(image_path):
99
 
100
  aligned_faces = []
101
  for face in faces:
102
- # Convert the dlib rectangle to a tuple for compatibility with dlib.get_face_chip
103
- face_coords = (face.left(), face.top(), face.right(), face.bottom())
104
  # Use dlib for face alignment
105
- landmarks = shape_predictor(gray, dlib.rectangle(*face_coords))
106
  aligned_face = dlib.get_face_chip(resized_image, landmarks, size=256) # Adjust the size as needed
107
  aligned_faces.append(aligned_face)
108
 
 
99
 
100
  aligned_faces = []
101
  for face in faces:
 
 
102
  # Use dlib for face alignment
103
+ landmarks = shape_predictor(gray, face)
104
  aligned_face = dlib.get_face_chip(resized_image, landmarks, size=256) # Adjust the size as needed
105
  aligned_faces.append(aligned_face)
106