bankholdup commited on
Commit
cc5a389
1 Parent(s): 117d66b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -105,7 +105,8 @@ cat_decoder.to(device)
105
  def run_alignment(image_path):
106
  import dlib
107
  from e4e.utils.alignment import align_face
108
- predictor = dlib.shape_predictor("bankholdup/stylegan_petbreeder/shape_predictor_68_face_landmarks.dat")
 
109
  aligned_image = align_face(filepath=image_path, predictor=predictor)
110
  print("Aligned image has shape: {}".format(aligned_image.size))
111
  return aligned_image
 
105
  def run_alignment(image_path):
106
  import dlib
107
  from e4e.utils.alignment import align_face
108
+ dlib_path = hf_hub_download(repo_id="bankholdup/stylegan_petbreeder", filename="shape_predictor_68_face_landmarks.dat")
109
+ predictor = dlib.shape_predictor(dlib_path)
110
  aligned_image = align_face(filepath=image_path, predictor=predictor)
111
  print("Aligned image has shape: {}".format(aligned_image.size))
112
  return aligned_image