Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,7 +65,7 @@ def sh(cmd_list, extra_env=None):
|
|
| 65 |
|
| 66 |
# install with FORCE_CUDA=1
|
| 67 |
sh(["pip", "install", "diso"], {"FORCE_CUDA": "1"})
|
| 68 |
-
sh(["pip", "install", "torch-cluster", "-f", "https://data.pyg.org/whl/torch-2.7.0+126.html"])
|
| 69 |
|
| 70 |
|
| 71 |
|
|
@@ -154,17 +154,6 @@ def run_triposg(image_path: str,
|
|
| 154 |
merged.export(glb_path)
|
| 155 |
|
| 156 |
mesh_file = first_file_from_dir(export_dir, "glb")
|
| 157 |
-
|
| 158 |
-
print(mesh_file)
|
| 159 |
-
|
| 160 |
-
# 1) Check for the file’s existence
|
| 161 |
-
if not os.path.exists(glb_path):
|
| 162 |
-
raise FileNotFoundError(f"No merged .glb found at {glb_path}")
|
| 163 |
-
|
| 164 |
-
# 2) List every file in the folder
|
| 165 |
-
all_files = os.listdir(export_dir)
|
| 166 |
-
|
| 167 |
-
print(f"Files in {export_dir}: {all_files}")
|
| 168 |
|
| 169 |
return mesh_file, export_dir
|
| 170 |
|
|
@@ -203,9 +192,31 @@ def build_demo():
|
|
| 203 |
remove_bg = gr.Checkbox(value=False, label="Remove Background (RMBG)")
|
| 204 |
|
| 205 |
with gr.Column(scale=1):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
output_model = gr.Model3D(label="Merged 3D Object")
|
| 207 |
output_dir = gr.Textbox(label="Export Directory")
|
| 208 |
examples = gr.Examples(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
examples=[
|
| 210 |
[
|
| 211 |
"assets/images/np4_7bd5d25aa77b4fb18e780d7a4c97d342.png",
|
|
|
|
| 65 |
|
| 66 |
# install with FORCE_CUDA=1
|
| 67 |
sh(["pip", "install", "diso"], {"FORCE_CUDA": "1"})
|
| 68 |
+
# sh(["pip", "install", "torch-cluster", "-f", "https://data.pyg.org/whl/torch-2.7.0+126.html"])
|
| 69 |
|
| 70 |
|
| 71 |
|
|
|
|
| 154 |
merged.export(glb_path)
|
| 155 |
|
| 156 |
mesh_file = first_file_from_dir(export_dir, "glb")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
return mesh_file, export_dir
|
| 159 |
|
|
|
|
| 192 |
remove_bg = gr.Checkbox(value=False, label="Remove Background (RMBG)")
|
| 193 |
|
| 194 |
with gr.Column(scale=1):
|
| 195 |
+
gr.HTML(
|
| 196 |
+
"""
|
| 197 |
+
<p style="opacity: 0.6; font-style: italic;">
|
| 198 |
+
This might take a few seconds to load the 3D model
|
| 199 |
+
</p>
|
| 200 |
+
"""
|
| 201 |
+
)
|
| 202 |
output_model = gr.Model3D(label="Merged 3D Object")
|
| 203 |
output_dir = gr.Textbox(label="Export Directory")
|
| 204 |
examples = gr.Examples(
|
| 205 |
+
|
| 206 |
+
examples=[
|
| 207 |
+
[
|
| 208 |
+
"assets/images/np5_b81f29e567ea4db48014f89c9079e403.png",
|
| 209 |
+
10,
|
| 210 |
+
],
|
| 211 |
+
|
| 212 |
+
],
|
| 213 |
+
examples=[
|
| 214 |
+
[
|
| 215 |
+
"assets/images/np10_cc486e491a2c499f9fd2aad2b02c6ccb.png",
|
| 216 |
+
10,
|
| 217 |
+
],
|
| 218 |
+
|
| 219 |
+
],
|
| 220 |
examples=[
|
| 221 |
[
|
| 222 |
"assets/images/np4_7bd5d25aa77b4fb18e780d7a4c97d342.png",
|