advcloud
commited on
Commit
·
d205773
1
Parent(s):
f6c278f
first commit
Browse files
app.py
CHANGED
|
@@ -109,11 +109,11 @@ img#teaser {
|
|
| 109 |
'<center></center>'
|
| 110 |
)
|
| 111 |
|
| 112 |
-
preprocess_button.click(fn=model.
|
| 113 |
inputs=[input_image],
|
| 114 |
outputs=[aligned_face])
|
| 115 |
aligned_face.change(fn=model.reconstruct_face,
|
| 116 |
-
inputs=[
|
| 117 |
outputs=[reconstructed_face, latent])
|
| 118 |
|
| 119 |
run_button.click(fn=model.generate,
|
|
|
|
| 109 |
'<center></center>'
|
| 110 |
)
|
| 111 |
|
| 112 |
+
preprocess_button.click(fn=model.detect_and_align_face,
|
| 113 |
inputs=[input_image],
|
| 114 |
outputs=[aligned_face])
|
| 115 |
aligned_face.change(fn=model.reconstruct_face,
|
| 116 |
+
inputs=[aligned_face],
|
| 117 |
outputs=[reconstructed_face, latent])
|
| 118 |
|
| 119 |
run_button.click(fn=model.generate,
|
model.py
CHANGED
|
@@ -49,8 +49,8 @@ class Model:
|
|
| 49 |
@staticmethod
|
| 50 |
def _create_dlib_landmark_model():
|
| 51 |
path = huggingface_hub.hf_hub_download(
|
| 52 |
-
'
|
| 53 |
-
'
|
| 54 |
)
|
| 55 |
return dlib.shape_predictor(path)
|
| 56 |
|
|
|
|
| 49 |
@staticmethod
|
| 50 |
def _create_dlib_landmark_model():
|
| 51 |
path = huggingface_hub.hf_hub_download(
|
| 52 |
+
'PKUWilliamYang/VToonify',
|
| 53 |
+
'models/shape_predictor_68_face_landmarks.dat'
|
| 54 |
)
|
| 55 |
return dlib.shape_predictor(path)
|
| 56 |
|