app
Browse files
app.py
CHANGED
|
@@ -97,7 +97,8 @@ def create_lmm():
|
|
| 97 |
|
| 98 |
# device = 'cpu'
|
| 99 |
device = 'cuda'
|
| 100 |
-
type = "hf"
|
|
|
|
| 101 |
|
| 102 |
if type == "local":
|
| 103 |
load_file_list = {
|
|
@@ -210,6 +211,8 @@ def generate(prompt, audio_path, length):
|
|
| 210 |
os.mkdir("outputs")
|
| 211 |
result_path = "outputs/" + str(int(time.time())) + ".mp4"
|
| 212 |
print(audio_path)
|
|
|
|
|
|
|
| 213 |
if audio_path.endswith("placeholder.wav"):
|
| 214 |
audio_path = None
|
| 215 |
if len(prompt) == 0:
|
|
@@ -242,9 +245,12 @@ demo = gr.Interface(
|
|
| 242 |
inputs=[input_text, input_audio, gr.Slider(20, 200, value=60, label="Motion length (fps 20):")],
|
| 243 |
outputs=gr.Video(label="Video:"),
|
| 244 |
examples=[
|
| 245 |
-
["A person walks in a circle.", load_file_list["audio_placeholder"], 120],
|
| 246 |
-
["A person jumps forward.", load_file_list["audio_placeholder"], 100],
|
| 247 |
-
["A person is stretching arms.", load_file_list["audio_placeholder"], 80],
|
|
|
|
|
|
|
|
|
|
| 248 |
["", load_file_list["audio_surprise"], 200],
|
| 249 |
["", load_file_list["audio_angry"], 200],
|
| 250 |
],
|
|
|
|
| 97 |
|
| 98 |
# device = 'cpu'
|
| 99 |
device = 'cuda'
|
| 100 |
+
# type = "hf"
|
| 101 |
+
type = "local"
|
| 102 |
|
| 103 |
if type == "local":
|
| 104 |
load_file_list = {
|
|
|
|
| 211 |
os.mkdir("outputs")
|
| 212 |
result_path = "outputs/" + str(int(time.time())) + ".mp4"
|
| 213 |
print(audio_path)
|
| 214 |
+
if not os.path.exists(audio_path):
|
| 215 |
+
audio_path = None
|
| 216 |
if audio_path.endswith("placeholder.wav"):
|
| 217 |
audio_path = None
|
| 218 |
if len(prompt) == 0:
|
|
|
|
| 245 |
inputs=[input_text, input_audio, gr.Slider(20, 200, value=60, label="Motion length (fps 20):")],
|
| 246 |
outputs=gr.Video(label="Video:"),
|
| 247 |
examples=[
|
| 248 |
+
# ["A person walks in a circle.", load_file_list["audio_placeholder"], 120],
|
| 249 |
+
# ["A person jumps forward.", load_file_list["audio_placeholder"], 100],
|
| 250 |
+
# ["A person is stretching arms.", load_file_list["audio_placeholder"], 80],
|
| 251 |
+
["A person walks in a circle.", "None", 120],
|
| 252 |
+
["A person jumps forward.", "None", 100],
|
| 253 |
+
["A person is stretching arms.", "None", 80],
|
| 254 |
["", load_file_list["audio_surprise"], 200],
|
| 255 |
["", load_file_list["audio_angry"], 200],
|
| 256 |
],
|