Spaces:
Runtime error
Runtime error
import torch | |
import time | |
import os | |
OPENAI_API_KEY = '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' | |
path_id = "" | |
checkpoint_path="wav2lip/wav2lip_gan.pth" | |
outfile="out.mp4" | |
audiofile="voices/output.mp3" | |
#imgfile="images/output.png" | |
imgfile="images/image.png" | |
driverfile="face_vid2vid/assets/christmas.mp4" | |
animatedfile="animated.mp4" | |
static=False | |
fps=25 | |
pads=[0, 10, 0, 0] | |
face_det_batch_size=16 | |
wav2lip_batch_size=128 | |
resize_factor=0.5 | |
crop=[0, -1, 0, -1] | |
box=[-1, -1, -1, -1] | |
img_size = 96 | |
rotate=False | |
nosmooth=False | |
mel_step_size = 16 | |
# device = 'cuda' if torch.cuda.is_available() else 'cpu' | |
device = 'cpu' | |
print('Using {} for inference.'.format(device)) | |
import warnings | |
warnings.filterwarnings('ignore') | |
def init_path_id(): | |
path_id = str(int(time.time())) | |
path = os.path.join("temp", path_id) | |
os.makedirs(path, exist_ok=True) | |
return path_id, path | |