dooraven commited on
Commit
16546f4
1 Parent(s): 1cecf80
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,7 +8,7 @@ import numpy as np
8
  import argparse
9
 
10
  from point_e.diffusion.configs import DIFFUSION_CONFIGS, diffusion_from_config
11
- from .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
 
@@ -117,7 +117,7 @@ def generate_3D(input, model_name='base1B', guidance_scale=3.0, grid_size=128):
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('')
@@ -148,10 +148,10 @@ def ply_to_glb(ply_file, glb_file):
148
 
149
  return glb_file
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
 
157
  def create_gif(pc):
 
8
  import argparse
9
 
10
  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
 
 
117
  set_state('Converting to mesh...')
118
 
119
  uniqid = uuid.uuid4()
120
+ file_path = f'/tmp/mesh-{uniqid}.npy'
121
  save_ply(pc, file_path)
122
 
123
  set_state('')
 
148
 
149
  return glb_file
150
 
151
+ def save_plz(pc, file_name):
152
  # Produce a mesh (with vertex colors)
153
  with open(file_name, 'wb') as f:
154
+ np.save(f, pc.coords)
155
 
156
 
157
  def create_gif(pc):