File size: 884 Bytes
efe586f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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