hysts HF staff commited on
Commit
e96fada
·
1 Parent(s): 4a1ea9e
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -63,7 +63,7 @@ class App:
63
 
64
  def __init__(self, device: torch.device):
65
  self.device = device
66
- self.face_detector = self._create_dlib_landmark_model()
67
  self.encoder = self._load_encoder()
68
  self.transform = self._create_transform()
69
 
@@ -143,7 +143,7 @@ class App:
143
  return exstyles
144
 
145
  def detect_and_align_face(self, image) -> np.ndarray:
146
- image = align_face(filepath=image.name, predictor=self.face_detector)
147
  return image
148
 
149
  @staticmethod
 
63
 
64
  def __init__(self, device: torch.device):
65
  self.device = device
66
+ self.landmark_model = self._create_dlib_landmark_model()
67
  self.encoder = self._load_encoder()
68
  self.transform = self._create_transform()
69
 
 
143
  return exstyles
144
 
145
  def detect_and_align_face(self, image) -> np.ndarray:
146
+ image = align_face(filepath=image.name, predictor=self.landmark_model)
147
  return image
148
 
149
  @staticmethod