Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ huggingface_hub.hf_hub_download(
|
|
| 24 |
|
| 25 |
huggingface_hub.hf_hub_download(
|
| 26 |
repo_id='ixaac/MimicMotion',
|
| 27 |
-
filename='MimicMotion_1
|
| 28 |
local_dir='./models',
|
| 29 |
local_dir_use_symlinks=False,
|
| 30 |
)
|
|
@@ -52,14 +52,14 @@ def infer(ref_video_in, ref_image_in):
|
|
| 52 |
# Define the values for the variables
|
| 53 |
ref_video_path = ref_video_in
|
| 54 |
ref_image_path = ref_image_in
|
| 55 |
-
num_frames =
|
| 56 |
resolution = 576
|
| 57 |
frames_overlap = 6
|
| 58 |
num_inference_steps = 25
|
| 59 |
noise_aug_strength = 0
|
| 60 |
guidance_scale = 2.0
|
| 61 |
sample_stride = 2
|
| 62 |
-
fps =
|
| 63 |
seed = 42
|
| 64 |
|
| 65 |
# Create the data structure
|
|
@@ -93,12 +93,24 @@ def infer(ref_video_in, ref_image_in):
|
|
| 93 |
print("YAML file 'config.yaml' created successfully in", file_path)
|
| 94 |
|
| 95 |
# Execute the inference command
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
|
| 104 |
return "done"
|
|
|
|
| 24 |
|
| 25 |
huggingface_hub.hf_hub_download(
|
| 26 |
repo_id='ixaac/MimicMotion',
|
| 27 |
+
filename='MimicMotion_1.pth',
|
| 28 |
local_dir='./models',
|
| 29 |
local_dir_use_symlinks=False,
|
| 30 |
)
|
|
|
|
| 52 |
# Define the values for the variables
|
| 53 |
ref_video_path = ref_video_in
|
| 54 |
ref_image_path = ref_image_in
|
| 55 |
+
num_frames = 16
|
| 56 |
resolution = 576
|
| 57 |
frames_overlap = 6
|
| 58 |
num_inference_steps = 25
|
| 59 |
noise_aug_strength = 0
|
| 60 |
guidance_scale = 2.0
|
| 61 |
sample_stride = 2
|
| 62 |
+
fps = 12
|
| 63 |
seed = 42
|
| 64 |
|
| 65 |
# Create the data structure
|
|
|
|
| 93 |
print("YAML file 'config.yaml' created successfully in", file_path)
|
| 94 |
|
| 95 |
# Execute the inference command
|
| 96 |
+
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
| 97 |
+
# Print logs in real-time
|
| 98 |
+
while True:
|
| 99 |
+
output = process.stdout.readline()
|
| 100 |
+
if output == '' and process.poll() is not None:
|
| 101 |
+
break
|
| 102 |
+
if output:
|
| 103 |
+
print(output.strip())
|
| 104 |
+
|
| 105 |
+
# Print any remaining output
|
| 106 |
+
for output in process.stdout:
|
| 107 |
+
print(output.strip())
|
| 108 |
+
for error in process.stderr:
|
| 109 |
+
print(error.strip())
|
| 110 |
+
|
| 111 |
+
# Wait for the process to complete and get the return code
|
| 112 |
+
return_code = process.wait()
|
| 113 |
+
print("Inference script finished with return code:", return_code)
|
| 114 |
|
| 115 |
|
| 116 |
return "done"
|