MeYourHint commited on
Commit
feb4121
Β·
1 Parent(s): b91097e
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -4,8 +4,8 @@ import os
4
  import torch
5
  import numpy as np
6
  import gradio as gr
7
- import gdown
8
  import random
 
9
 
10
  print(f"Is CUDA available: {torch.cuda.is_available()}")
11
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
@@ -31,7 +31,13 @@ WEBSITE = """
31
  </h3>
32
  <h3> Description </h3>
33
  <p>
34
- This space illustrates <a href='https://ericguo5513.github.io/momask/' target='_blank'><b>MoMask</b></a>, a method for text-to-motion generation.
 
 
 
 
 
 
35
  </p>
36
  </div>
37
  """
@@ -92,7 +98,7 @@ def generate(
92
  "url": f"generation/{uid}/animations/0/sample0_repeat{n}_len{motion_length}_ik.mp4"
93
  }
94
  datas.append(data_unit)
95
- print(datas)
96
  return datas
97
 
98
 
@@ -172,7 +178,7 @@ with gr.Blocks(css=CSS, theme=theme) as demo:
172
  i += 1
173
  video = gr.HTML()
174
  videos.append(video)
175
-
176
  # connect the examples to the output
177
  # a bit hacky
178
  examples.outputs = videos
@@ -202,6 +208,7 @@ with gr.Blocks(css=CSS, theme=theme) as demo:
202
  )
203
 
204
  def clear_videos():
 
205
  return [None for x in range(4)] + [DEFAULT_TEXT]
206
 
207
  clear.click(fn=clear_videos, outputs=videos + [text])
 
4
  import torch
5
  import numpy as np
6
  import gradio as gr
 
7
  import random
8
+ import shutil
9
 
10
  print(f"Is CUDA available: {torch.cuda.is_available()}")
11
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
 
31
  </h3>
32
  <h3> Description </h3>
33
  <p>
34
+ πŸ”₯πŸ”₯πŸ”₯This space presents an interactive demo for <a href='https://ericguo5513.github.io/momask/' target='_blank'><b>MoMask</b></a>, a method for text-to-motion generation. Motion editing, uploading and .bvh downloading are coming soon!!! πŸš€πŸš€
35
+ </p>
36
+ </div>
37
+ """
38
+ WEBSITE_bottom = """
39
+ <p>
40
+ We thanks <a href="https://huggingface.co/spaces/Mathux/TMR" target="_blank">TMR</a> for this cool space template.
41
  </p>
42
  </div>
43
  """
 
98
  "url": f"generation/{uid}/animations/0/sample0_repeat{n}_len{motion_length}_ik.mp4"
99
  }
100
  datas.append(data_unit)
101
+ print(datas)
102
  return datas
103
 
104
 
 
178
  i += 1
179
  video = gr.HTML()
180
  videos.append(video)
181
+ gr.Markdown(WEBSITE_bottom)
182
  # connect the examples to the output
183
  # a bit hacky
184
  examples.outputs = videos
 
208
  )
209
 
210
  def clear_videos():
211
+ shutil.rmtree('./generation')
212
  return [None for x in range(4)] + [DEFAULT_TEXT]
213
 
214
  clear.click(fn=clear_videos, outputs=videos + [text])