Spaces:
Sleeping
Sleeping
mahiatlinux
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ from functools import partial
|
|
14 |
from kiui.op import recenter
|
15 |
import kiui
|
16 |
from gradio_litmodel3d import LitModel3D
|
|
|
17 |
|
18 |
# we load the pre-trained model from HF
|
19 |
class LRMGeneratorWrapper:
|
@@ -152,7 +153,7 @@ def _default_render_cameras(batch_size: int = 1):
|
|
152 |
render_camera_intrinsics = _default_intrinsics().unsqueeze(0).repeat(extrinsics.shape[0], 1, 1)
|
153 |
render_cameras = _build_camera_standard(extrinsics, render_camera_intrinsics)
|
154 |
return render_cameras.unsqueeze(0).repeat(batch_size, 1, 1)
|
155 |
-
|
156 |
def generate_mesh(image, source_size=512, render_size=384, mesh_size=512, export_mesh=False, export_video=True, fps=30):
|
157 |
image = preprocess_image(image, source_size).to(model_wrapper.device)
|
158 |
source_camera = _default_source_camera(batch_size=1).to(model_wrapper.device)
|
|
|
14 |
from kiui.op import recenter
|
15 |
import kiui
|
16 |
from gradio_litmodel3d import LitModel3D
|
17 |
+
import spaces
|
18 |
|
19 |
# we load the pre-trained model from HF
|
20 |
class LRMGeneratorWrapper:
|
|
|
153 |
render_camera_intrinsics = _default_intrinsics().unsqueeze(0).repeat(extrinsics.shape[0], 1, 1)
|
154 |
render_cameras = _build_camera_standard(extrinsics, render_camera_intrinsics)
|
155 |
return render_cameras.unsqueeze(0).repeat(batch_size, 1, 1)
|
156 |
+
@spaces.GPU()
|
157 |
def generate_mesh(image, source_size=512, render_size=384, mesh_size=512, export_mesh=False, export_video=True, fps=30):
|
158 |
image = preprocess_image(image, source_size).to(model_wrapper.device)
|
159 |
source_camera = _default_source_camera(batch_size=1).to(model_wrapper.device)
|