Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ import time
|
|
25 |
start_time = time.time()
|
26 |
|
27 |
class AnimationConfig:
|
28 |
-
def __init__(self, driven_audio_path, source_image_path, result_folder,pose_style,expression_scale,enhancer,still):
|
29 |
self.driven_audio = driven_audio_path
|
30 |
self.source_image = source_image_path
|
31 |
self.ref_eyeblink = None
|
@@ -44,7 +44,7 @@ class AnimationConfig:
|
|
44 |
self.cpu = False
|
45 |
self.face3dvis = False
|
46 |
self.still = still
|
47 |
-
self.preprocess =
|
48 |
self.verbose = False
|
49 |
self.old_version = False
|
50 |
self.net_recon = 'resnet50'
|
@@ -212,6 +212,8 @@ def generate_video():
|
|
212 |
still_str = request.form.get('still', 'False')
|
213 |
still = still_str.lower() == 'true'
|
214 |
print('still', still)
|
|
|
|
|
215 |
|
216 |
if target_language != 'original_text':
|
217 |
response = translate_text(text_prompt, target_language)
|
@@ -260,7 +262,7 @@ def generate_video():
|
|
260 |
os.makedirs(result_folder, exist_ok=True)
|
261 |
|
262 |
# Example of using the class with some hypothetical paths
|
263 |
-
args = AnimationConfig(driven_audio_path=driven_audio_path, source_image_path=source_image_path, result_folder=result_folder, pose_style=pose_style, expression_scale=expression_scale, enhancer=enhancer,still=still)
|
264 |
|
265 |
if torch.cuda.is_available() and not args.cpu:
|
266 |
args.device = "cuda"
|
|
|
25 |
start_time = time.time()
|
26 |
|
27 |
class AnimationConfig:
|
28 |
+
def __init__(self, driven_audio_path, source_image_path, result_folder,pose_style,expression_scale,enhancer,still,preprocess):
|
29 |
self.driven_audio = driven_audio_path
|
30 |
self.source_image = source_image_path
|
31 |
self.ref_eyeblink = None
|
|
|
44 |
self.cpu = False
|
45 |
self.face3dvis = False
|
46 |
self.still = still
|
47 |
+
self.preprocess = preprocess
|
48 |
self.verbose = False
|
49 |
self.old_version = False
|
50 |
self.net_recon = 'resnet50'
|
|
|
212 |
still_str = request.form.get('still', 'False')
|
213 |
still = still_str.lower() == 'true'
|
214 |
print('still', still)
|
215 |
+
preprocess = request.form.get('preprocess', 'crop')
|
216 |
+
print('preprocess selected: ',preprocess)
|
217 |
|
218 |
if target_language != 'original_text':
|
219 |
response = translate_text(text_prompt, target_language)
|
|
|
262 |
os.makedirs(result_folder, exist_ok=True)
|
263 |
|
264 |
# Example of using the class with some hypothetical paths
|
265 |
+
args = AnimationConfig(driven_audio_path=driven_audio_path, source_image_path=source_image_path, result_folder=result_folder, pose_style=pose_style, expression_scale=expression_scale, enhancer=enhancer,still=still,preprocess=preprocess)
|
266 |
|
267 |
if torch.cuda.is_available() and not args.cpu:
|
268 |
args.device = "cuda"
|