Spaces:
Runtime error
Runtime error
wip
Browse files
app.py
CHANGED
@@ -11,8 +11,6 @@ from point_e.diffusion.configs import DIFFUSION_CONFIGS, diffusion_from_config
|
|
11 |
from point_e.diffusion.sampler import PointCloudSampler
|
12 |
from point_e.models.download import load_checkpoint
|
13 |
from point_e.models.configs import MODEL_CONFIGS, model_from_config
|
14 |
-
from point_e.util.plotting import plot_point_cloud
|
15 |
-
from point_e.util.ply_util import write_ply
|
16 |
|
17 |
from diffusers import StableDiffusionPipeline
|
18 |
|
@@ -119,10 +117,7 @@ def generate_3D(input, model_name='base1B', guidance_scale=3.0, grid_size=128):
|
|
119 |
set_state('Converting to mesh...')
|
120 |
|
121 |
uniqid = uuid.uuid4()
|
122 |
-
file_path = f
|
123 |
-
|
124 |
-
print('file_path', file_path)
|
125 |
-
|
126 |
save_ply(pc, file_path)
|
127 |
|
128 |
set_state('')
|
@@ -155,9 +150,7 @@ def ply_to_glb(ply_file, glb_file):
|
|
155 |
|
156 |
def save_ply(pc, file_name):
|
157 |
# Produce a mesh (with vertex colors)
|
158 |
-
print('file_name', file_name)
|
159 |
with open(file_name, 'wb') as f:
|
160 |
-
print('file_name', f)
|
161 |
pc.save(f)
|
162 |
|
163 |
|
|
|
11 |
from point_e.diffusion.sampler import PointCloudSampler
|
12 |
from point_e.models.download import load_checkpoint
|
13 |
from point_e.models.configs import MODEL_CONFIGS, model_from_config
|
|
|
|
|
14 |
|
15 |
from diffusers import StableDiffusionPipeline
|
16 |
|
|
|
117 |
set_state('Converting to mesh...')
|
118 |
|
119 |
uniqid = uuid.uuid4()
|
120 |
+
file_path = f'/tmp/mesh-{uniqid}.npz'
|
|
|
|
|
|
|
121 |
save_ply(pc, file_path)
|
122 |
|
123 |
set_state('')
|
|
|
150 |
|
151 |
def save_ply(pc, file_name):
|
152 |
# Produce a mesh (with vertex colors)
|
|
|
153 |
with open(file_name, 'wb') as f:
|
|
|
154 |
pc.save(f)
|
155 |
|
156 |
|