EvanTHU commited on
Commit
81db318
·
1 Parent(s): a8cd8ac

Add application file

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -1,16 +1,29 @@
1
  import gradio as gr
2
  import os
 
 
3
 
4
  def see_files(path):
5
  return os.listdir(path)
6
 
 
 
 
7
  def greet(name):
8
  return "Hello " + name + "!!"
9
 
 
 
 
10
  REPO_ID = "EvanTHU/MoVid"
11
- FILENAME = "animation-video.zip"
12
- file = hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="dataset")
13
- print(file)
 
 
 
 
 
14
 
15
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
16
  demo.launch()
 
1
  import gradio as gr
2
  import os
3
+ from huggingface_hub import hf_hub_download
4
+
5
 
6
  def see_files(path):
7
  return os.listdir(path)
8
 
9
+ def unzip_file(filename):
10
+ cmd = f"nzip -P lhchensllu ./Movid/{filename} -d ./videos"
11
+
12
  def greet(name):
13
  return "Hello " + name + "!!"
14
 
15
+ os.system("mkdir Movid")
16
+ os.system("mkdir videos")
17
+
18
  REPO_ID = "EvanTHU/MoVid"
19
+
20
+ filelist = ["animation", "dance", "haa500", "humman", "idea400", "kungfu", "music", "perform"]
21
+ for file_ in filelist:
22
+ filename = f"{file_}-video.zip"
23
+ file = hf_hub_download(repo_id=REPO_ID, filename=filename, repo_type="dataset", local_dir="./Movid")
24
+ unzip_file(filename)
25
+
26
+ hf_hub_download(repo_id=REPO_ID, filename="video-QA.json", repo_type="dataset", local_dir="./Movid")
27
 
28
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
29
  demo.launch()