Spaces:
Sleeping
Sleeping
Commit
·
4a63fe7
1
Parent(s):
aa366ec
Add dlib-binary for better face alignment accuracy
Browse files- requirements.txt +1 -0
- runners/simple_runner.py +2 -5
requirements.txt
CHANGED
|
@@ -19,3 +19,4 @@ torch
|
|
| 19 |
torchvision
|
| 20 |
clip @ git+https://github.com/openai/CLIP.git@a1d071733d7111c9c014f024669f959182114e33
|
| 21 |
spaces>=0.28.3
|
|
|
|
|
|
| 19 |
torchvision
|
| 20 |
clip @ git+https://github.com/openai/CLIP.git@a1d071733d7111c9c014f024669f959182114e33
|
| 21 |
spaces>=0.28.3
|
| 22 |
+
dlib-binary
|
runners/simple_runner.py
CHANGED
|
@@ -63,11 +63,8 @@ def extract_mask(image_path, save_dir_path, trash=0.995):
|
|
| 63 |
|
| 64 |
|
| 65 |
def run_alignment(image_path):
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
from scripts.align_all_parallel import align_face
|
| 69 |
-
except ImportError:
|
| 70 |
-
raise ImportError("dlib is required for face alignment. Please install dlib or disable face alignment.")
|
| 71 |
|
| 72 |
predictor = dlib.shape_predictor("pretrained_models/shape_predictor_68_face_landmarks.dat")
|
| 73 |
aligned_image, unalign_dict = align_face(filepath=image_path, predictor=predictor)
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
def run_alignment(image_path):
|
| 66 |
+
import dlib
|
| 67 |
+
from scripts.align_all_parallel import align_face
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
predictor = dlib.shape_predictor("pretrained_models/shape_predictor_68_face_landmarks.dat")
|
| 70 |
aligned_image, unalign_dict = align_face(filepath=image_path, predictor=predictor)
|