Spaces:
Build error
Build error
Update app.py
Browse files64 unmodified lines6566676869707182 unmodified lines15415515615715815916016116216316416516616716816917032 unmodified lines20320420520620720820921021164 unmodified lines# install with FORCE_CUDA=1sh(["pip", "install", "diso"], {"FORCE_CUDA": "1"})sh(["pip", "install", "torch-cluster", "-f", "https://data.pyg.org/whl/torch-2.7.0+126.html"])82 unmodified linesmerged.export(glb_path)mesh_file = first_file_from_dir(export_dir, "glb")print(mesh_file)# 1) Check for the file’s existenceif not os.path.exists(glb_path):raise FileNotFoundError(f"No merged .glb found at {glb_path}")# 2) List every file in the folderall_files = os.listdir(export_dir)print(f"Files in {export_dir}: {all_files}")return mesh_file, export_dir32 unmodified linesremove_bg = gr.Checkbox(value=False, label="Remove Background (RMBG)")with gr.Column(scale=1):output_model = gr.Model3D(label="Merged 3D Object")output_dir = gr.Textbox(label="Export Directory")examples = gr.Examples(examples=[["assets/images/np4_7bd5d25aa77b4fb18e780d7a4c97d342.png",64 unmodified lines6566676869707182 unmodified lines15415515615715815932 unmodified lines19219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122264 unmodified lines# install with FORCE_CUDA=1sh(["pip", "install", "diso"], {"FORCE_CUDA": "1"})# sh(["pip", "install", "torch-cluster", "-f", "https://data.pyg.org/whl/torch-2.7.0+126.html"])82 unmodified linesmerged.export(glb_path)mesh_file = first_file_from_dir(export_dir, "glb")return mesh_file, export_dir32 unmodified linesremove_bg = gr.Checkbox(value=False, label="Remove Background (RMBG)")with gr.Column(scale=1):gr.HTML("""<p style="opacity: 0.6; font-style: italic;">This might take a few seconds to load the 3D model</p>""")output_model = gr.Model3D(label="Merged 3D Object")output_dir = gr.Textbox(label="Export Directory")examples = gr.Examples(examples=[["assets/images/np5_b81f29e567ea4db48014f89c9079e403.png",10,],],examples=[["assets/images/np10_cc486e491a2c499f9fd2aad2b02c6ccb.png",10,],],examples=[["assets/images/np4_7bd5d25aa77b4fb18e780d7a4c97d342.png",
app.py+23-12