Spaces:
Runtime error
Runtime error
Commit
·
6411c28
1
Parent(s):
52918fa
style: lint all
Browse files
app.py
CHANGED
@@ -6,12 +6,13 @@ import gradio as gr
|
|
6 |
|
7 |
def load_mesh(mesh_file_name):
|
8 |
try:
|
9 |
-
subprocess.run(["cd","text2room","&&","python", "generate_scene.py"])
|
10 |
except Exception as e:
|
11 |
print(e)
|
12 |
search_files(".ply")
|
13 |
return mesh_file_name
|
14 |
|
|
|
15 |
def search_files(extension):
|
16 |
# recursively search for files with the given extension
|
17 |
files = []
|
@@ -21,10 +22,11 @@ def search_files(extension):
|
|
21 |
print(os.listdir("text2room"))
|
22 |
return files
|
23 |
|
24 |
-
|
|
|
|
|
25 |
inputs=gr.Model3D(),
|
26 |
-
outputs=gr.Model3D(
|
27 |
-
clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
28 |
examples=[
|
29 |
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
|
30 |
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
|
@@ -34,5 +36,11 @@ iface = gr.Interface(fn=load_mesh,
|
|
34 |
)
|
35 |
|
36 |
if __name__ == "__main__":
|
37 |
-
subprocess.run(
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
iface.launch()
|
|
|
6 |
|
7 |
def load_mesh(mesh_file_name):
|
8 |
try:
|
9 |
+
subprocess.run(["cd", "text2room", "&&", "python", "generate_scene.py"])
|
10 |
except Exception as e:
|
11 |
print(e)
|
12 |
search_files(".ply")
|
13 |
return mesh_file_name
|
14 |
|
15 |
+
|
16 |
def search_files(extension):
|
17 |
# recursively search for files with the given extension
|
18 |
files = []
|
|
|
22 |
print(os.listdir("text2room"))
|
23 |
return files
|
24 |
|
25 |
+
|
26 |
+
iface = gr.Interface(
|
27 |
+
fn=load_mesh,
|
28 |
inputs=gr.Model3D(),
|
29 |
+
outputs=gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
|
|
30 |
examples=[
|
31 |
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
|
32 |
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
|
|
|
36 |
)
|
37 |
|
38 |
if __name__ == "__main__":
|
39 |
+
subprocess.run(
|
40 |
+
[
|
41 |
+
"pip",
|
42 |
+
"install",
|
43 |
+
"git+https://github.com/facebookresearch/pytorch3d.git@stable",
|
44 |
+
]
|
45 |
+
)
|
46 |
iface.launch()
|