Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
import yaml
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
+
|
6 |
+
huggingface_hub.hf_hub_download(
|
7 |
+
repo_id='yzd-v/DWPose',
|
8 |
+
filename='yolox_l.onnx',
|
9 |
+
local_dir='./models/DWPose',
|
10 |
+
local_dir_use_symlinks=False,
|
11 |
+
)
|
12 |
+
|
13 |
+
huggingface_hub.hf_hub_download(
|
14 |
+
repo_id='yzd-v/DWPose',
|
15 |
+
filename='dw-ll_ucoco_384.onnx',
|
16 |
+
local_dir='./models/DWPose',
|
17 |
+
local_dir_use_symlinks=False,
|
18 |
+
)
|
19 |
+
|
20 |
+
huggingface_hub.hf_hub_download(
|
21 |
+
repo_id='ixaac/MimicMotion',
|
22 |
+
filename='MimicMotion_1-1.pth',
|
23 |
+
local_dir='./models',
|
24 |
+
local_dir_use_symlinks=False,
|
25 |
+
)
|
26 |
+
|
27 |
+
def print_directory_contents(path):
|
28 |
+
for root, dirs, files in os.walk(path):
|
29 |
+
level = root.replace(path, '').count(os.sep)
|
30 |
+
indent = ' ' * 4 * (level)
|
31 |
+
print(f"{indent}{os.path.basename(root)}/")
|
32 |
+
subindent = ' ' * 4 * (level + 1)
|
33 |
+
for f in files:
|
34 |
+
print(f"{subindent}{f}")
|
35 |
+
|
36 |
+
# Path to the directory you want to print
|
37 |
+
directory_path = './models'
|
38 |
+
|
39 |
+
# Print the directory contents
|
40 |
+
print_directory_contents(directory_path)
|
41 |
+
|
42 |
+
def infer(text):
|
43 |
+
return text
|
44 |
+
|
45 |
+
demo = gr.Interface(
|
46 |
+
fn = infer,
|
47 |
+
inputs = [gr.Textbox()],
|
48 |
+
outputs = [gr.Textbox()]
|
49 |
+
)
|
50 |
+
|
51 |
+
demo.launch()
|