Update app.py
Browse files
app.py
CHANGED
|
@@ -73,7 +73,7 @@ def generate_motion(text, vqvae_model, transformer_model):
|
|
| 73 |
return pred_xyz.cpu().numpy().reshape(-1, 22, 3)
|
| 74 |
|
| 75 |
def infer(text):
|
| 76 |
-
print("Received text:", text)
|
| 77 |
try:
|
| 78 |
motion_data = generate_motion(text, vqvae_model, transformer_model)
|
| 79 |
if motion_data.size == 0:
|
|
@@ -85,12 +85,11 @@ def infer(text):
|
|
| 85 |
try:
|
| 86 |
gif_data = draw_to_batch([motion_data], [text], None)
|
| 87 |
if gif_data:
|
| 88 |
-
# Save the GIF to a permanent file rather than a temporary file for debugging
|
| 89 |
gif_filename = "output.gif"
|
| 90 |
gif_path = os.path.join(tempfile.gettempdir(), gif_filename)
|
| 91 |
with open(gif_path, "wb") as gif_file:
|
| 92 |
gif_file.write(gif_data)
|
| 93 |
-
print("GIF successfully saved to:", gif_path)
|
| 94 |
return gif_path
|
| 95 |
else:
|
| 96 |
print("Failed to generate GIF data.")
|
|
|
|
| 73 |
return pred_xyz.cpu().numpy().reshape(-1, 22, 3)
|
| 74 |
|
| 75 |
def infer(text):
|
| 76 |
+
print("Received text:", text)
|
| 77 |
try:
|
| 78 |
motion_data = generate_motion(text, vqvae_model, transformer_model)
|
| 79 |
if motion_data.size == 0:
|
|
|
|
| 85 |
try:
|
| 86 |
gif_data = draw_to_batch([motion_data], [text], None)
|
| 87 |
if gif_data:
|
|
|
|
| 88 |
gif_filename = "output.gif"
|
| 89 |
gif_path = os.path.join(tempfile.gettempdir(), gif_filename)
|
| 90 |
with open(gif_path, "wb") as gif_file:
|
| 91 |
gif_file.write(gif_data)
|
| 92 |
+
print("GIF successfully saved to:", gif_path)
|
| 93 |
return gif_path
|
| 94 |
else:
|
| 95 |
print("Failed to generate GIF data.")
|