Spaces:
Sleeping
Sleeping
Commit
路
fd1606e
1
Parent(s):
1345bfc
Update inference.py
Browse files- inference.py +6 -2
inference.py
CHANGED
|
@@ -9,6 +9,12 @@ from models import Wav2Lip
|
|
| 9 |
import platform
|
| 10 |
import cv2
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
parser = argparse.ArgumentParser(description='Inference code to lip-sync videos in the wild using Wav2Lip models')
|
| 13 |
|
| 14 |
parser.add_argument('--checkpoint_path', type=str,
|
|
@@ -126,8 +132,6 @@ def face_detect(images):
|
|
| 126 |
del detector
|
| 127 |
return results,head_exist
|
| 128 |
|
| 129 |
-
import cv2
|
| 130 |
-
|
| 131 |
def datagen(frames, mels):
|
| 132 |
img_batch,head_exist_batch, mel_batch, frame_batch, coords_batch = [], [], [], [],[]
|
| 133 |
|
|
|
|
| 9 |
import platform
|
| 10 |
import cv2
|
| 11 |
|
| 12 |
+
try:
|
| 13 |
+
last_face = cv2.imread("last_face.jpg")
|
| 14 |
+
except Exception as e:
|
| 15 |
+
print(f"No se pudo cargar 'last_face.jpg': {e}")
|
| 16 |
+
last_face = None
|
| 17 |
+
|
| 18 |
parser = argparse.ArgumentParser(description='Inference code to lip-sync videos in the wild using Wav2Lip models')
|
| 19 |
|
| 20 |
parser.add_argument('--checkpoint_path', type=str,
|
|
|
|
| 132 |
del detector
|
| 133 |
return results,head_exist
|
| 134 |
|
|
|
|
|
|
|
| 135 |
def datagen(frames, mels):
|
| 136 |
img_batch,head_exist_batch, mel_batch, frame_batch, coords_batch = [], [], [], [],[]
|
| 137 |
|