dooraven commited on
Commit
8ec8758
1 Parent(s): 826f1b1

save as npz

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -119,10 +119,10 @@ 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'/tmp/mesh-{uniqid}.ply'
123
 
124
  print(file_path)
125
- save_ply(pc, file_path)
126
 
127
  set_state('')
128
 
@@ -150,11 +150,6 @@ def ply_to_glb(ply_file, glb_file):
150
 
151
  return glb_file
152
 
153
- def save_ply(pc, file_name):
154
- # Produce a mesh (with vertex colors)
155
- with open(file_name, 'wb') as f:
156
- pc.write_ply(f)
157
-
158
 
159
  def create_gif(pc):
160
  fig = plt.figure(facecolor='black', figsize=(4, 4))
 
119
  set_state('Converting to mesh...')
120
 
121
  uniqid = uuid.uuid4()
122
+ file_path = f'/tmp/mesh-{uniqid}.npz'
123
 
124
  print(file_path)
125
+ pc.save(file_path)
126
 
127
  set_state('')
128
 
 
150
 
151
  return glb_file
152
 
 
 
 
 
 
153
 
154
  def create_gif(pc):
155
  fig = plt.figure(facecolor='black', figsize=(4, 4))