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):
|
| 29 |
self.driven_audio = driven_audio_path
|
| 30 |
self.source_image = source_image_path
|
| 31 |
self.ref_eyeblink = None
|
|
@@ -43,7 +43,7 @@ class AnimationConfig:
|
|
| 43 |
self.background_enhancer = None
|
| 44 |
self.cpu = False
|
| 45 |
self.face3dvis = False
|
| 46 |
-
self.still =
|
| 47 |
self.preprocess = 'crop'
|
| 48 |
self.verbose = False
|
| 49 |
self.old_version = False
|
|
@@ -209,6 +209,9 @@ def generate_video():
|
|
| 209 |
expression_scale = int(request.form.get('expression_scale', 1))
|
| 210 |
enhancer = request.form.get('enhancer', None)
|
| 211 |
voice_gender = request.form.get('voice_gender', 'male')
|
|
|
|
|
|
|
|
|
|
| 212 |
|
| 213 |
if target_language != 'original_text':
|
| 214 |
response = translate_text(text_prompt, target_language)
|
|
@@ -257,7 +260,7 @@ def generate_video():
|
|
| 257 |
os.makedirs(result_folder, exist_ok=True)
|
| 258 |
|
| 259 |
# Example of using the class with some hypothetical paths
|
| 260 |
-
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)
|
| 261 |
|
| 262 |
if torch.cuda.is_available() and not args.cpu:
|
| 263 |
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):
|
| 29 |
self.driven_audio = driven_audio_path
|
| 30 |
self.source_image = source_image_path
|
| 31 |
self.ref_eyeblink = None
|
|
|
|
| 43 |
self.background_enhancer = None
|
| 44 |
self.cpu = False
|
| 45 |
self.face3dvis = False
|
| 46 |
+
self.still = still
|
| 47 |
self.preprocess = 'crop'
|
| 48 |
self.verbose = False
|
| 49 |
self.old_version = False
|
|
|
|
| 209 |
expression_scale = int(request.form.get('expression_scale', 1))
|
| 210 |
enhancer = request.form.get('enhancer', None)
|
| 211 |
voice_gender = request.form.get('voice_gender', 'male')
|
| 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 |
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"
|