Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ from trimesh.exchange.gltf import export_glb
|
|
| 15 |
os.environ['PYOPENGL_PLATFORM'] = 'egl'
|
| 16 |
|
| 17 |
import gradio as gr
|
|
|
|
| 18 |
|
| 19 |
def parse_args():
|
| 20 |
parser = argparse.ArgumentParser(description='Create animations for 3D models')
|
|
@@ -351,6 +352,7 @@ def create_animation_mesh(input_mesh_path, animation_type='rotate', duration=3.0
|
|
| 351 |
|
| 352 |
return animated_glb_path, animated_gif_path
|
| 353 |
|
|
|
|
| 354 |
def process_3d_model(input_3d, animation_type, animation_duration, fps):
|
| 355 |
"""Process a 3D model and apply animation"""
|
| 356 |
print(f"Processing: {input_3d} with animation type: {animation_type}")
|
|
@@ -479,4 +481,4 @@ def create_gradio_interface():
|
|
| 479 |
# 메인 실행 부분
|
| 480 |
if __name__ == "__main__":
|
| 481 |
demo = create_gradio_interface()
|
| 482 |
-
demo.launch(share=True)
|
|
|
|
| 15 |
os.environ['PYOPENGL_PLATFORM'] = 'egl'
|
| 16 |
|
| 17 |
import gradio as gr
|
| 18 |
+
import spaces
|
| 19 |
|
| 20 |
def parse_args():
|
| 21 |
parser = argparse.ArgumentParser(description='Create animations for 3D models')
|
|
|
|
| 352 |
|
| 353 |
return animated_glb_path, animated_gif_path
|
| 354 |
|
| 355 |
+
@spaces.GPU
|
| 356 |
def process_3d_model(input_3d, animation_type, animation_duration, fps):
|
| 357 |
"""Process a 3D model and apply animation"""
|
| 358 |
print(f"Processing: {input_3d} with animation type: {animation_type}")
|
|
|
|
| 481 |
# 메인 실행 부분
|
| 482 |
if __name__ == "__main__":
|
| 483 |
demo = create_gradio_interface()
|
| 484 |
+
demo.launch(share=True, server_name="0.0.0.0", server_port=7860)
|