ckc99u commited on
Commit
9db0ebd
·
verified ·
1 Parent(s): 5d591a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -32
app.py CHANGED
@@ -262,10 +262,15 @@ def rignet_inference(input_obj, bandwidth, threshold):
262
  return None, error_msg
263
 
264
 
265
- # Create Gradio interface
266
- def create_interface():
267
- """Create and configure Gradio interface"""
 
 
 
 
268
 
 
269
  demo = gr.Interface(
270
  fn=rignet_inference,
271
  inputs=[
@@ -279,43 +284,30 @@ def create_interface():
279
  ],
280
  title="🎭 RigNet: Neural Rigging for 3D Characters",
281
  description="""
282
- Upload a 3D character mesh (OBJ format) to automatically generate skeletal rig and skinning weights.
283
-
284
- **Recommended:** OBJ files with 1K-5K vertices work best.
285
- **Processing time:** 1-3 minutes on CPU depending on mesh complexity.
286
  """,
287
  article="""
288
- ### 📚 About the Output
289
-
290
- The generated `*_rig.txt` file contains:
291
- - **joints**: 3D positions of skeletal joints
292
- - **root**: Root joint of the hierarchy
293
- - **hier**: Parent-child relationships (skeleton hierarchy)
294
- - **skin**: Skinning weights for each vertex
295
-
296
- This format can be imported into 3D animation software.
297
-
298
- **Reference:** [RigNet: Neural Rigging for Articulated Characters (SIGGRAPH 2020)](https://arxiv.org/abs/2005.00559)
299
  """,
300
  allow_flagging="never"
301
  )
302
 
303
- return demo
304
-
305
-
306
- if __name__ == "__main__":
307
- print("="*60)
308
- print("RigNet Gradio Demo - Starting...")
309
- print("="*60)
310
-
311
- # Pre-load models at startup
312
- load_models()
313
-
314
- # Create and launch interface
315
- demo = create_interface()
316
  demo.launch(
317
  server_name="0.0.0.0",
318
  server_port=7860,
319
  share=False,
320
- show_error=True # Show errors in UI
321
  )
 
262
  return None, error_msg
263
 
264
 
265
+ if __name__ == "__main__":
266
+ print("="*60)
267
+ print("RigNet Gradio Demo - Starting...")
268
+ print("="*60)
269
+
270
+ # Pre-load models at startup
271
+ load_models()
272
 
273
+ # Create and launch interface using gr.Interface
274
  demo = gr.Interface(
275
  fn=rignet_inference,
276
  inputs=[
 
284
  ],
285
  title="🎭 RigNet: Neural Rigging for 3D Characters",
286
  description="""
287
+ Upload a 3D character mesh (OBJ format) to automatically generate skeletal rig and skinning weights.
288
+
289
+ **Recommended:** OBJ files with 1K-5K vertices work best.
290
+ **Processing time:** 1-3 minutes on CPU depending on mesh complexity.
291
  """,
292
  article="""
293
+ ### 📚 About the Output
294
+
295
+ The generated `*_rig.txt` file contains:
296
+ - **joints**: 3D positions of skeletal joints
297
+ - **root**: Root joint of the hierarchy
298
+ - **hier**: Parent-child relationships (skeleton hierarchy)
299
+ - **skin**: Skinning weights for each vertex
300
+
301
+ This format can be imported into 3D animation software.
302
+
303
+ **Reference:** [RigNet: Neural Rigging for Articulated Characters (SIGGRAPH 2020)](https://arxiv.org/abs/2005.00559)
304
  """,
305
  allow_flagging="never"
306
  )
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  demo.launch(
309
  server_name="0.0.0.0",
310
  server_port=7860,
311
  share=False,
312
+ show_error=True
313
  )