-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
46 lines (41 loc) · 1.09 KB
/
config.py
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
41
42
43
44
45
46
import torch
import time
import os
path_id = ""
checkpoint_path="wav2lip/models/wav2lip_gan.pth"
tts_input="input.mp3"
tts_output="output.wav"
outfile="out.mp4"
audiofile="tmp.wav"
imgfile="avatar.png"
driverfile="face_vid2vid/assets/driver06.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'
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
# Function to read the content of the message file
def read_message_from_file(file_path):
with open(file_path, 'r') as file:
return file.read()
# Function to read the content of the message file
def read_prompt_from_file(file_path):
with open(file_path, 'r') as file:
return file.read()