cronos3k commited on
Commit
fcdcd8d
·
verified ·
1 Parent(s): b155b5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -119,8 +119,8 @@ def image_to_3d(
119
  "cfg_strength": slat_guidance_strength,
120
  },
121
  )
122
- video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
123
- video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
124
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
125
  trial_id = str(uuid.uuid4())
126
  video_path = os.path.join(user_dir, f"{trial_id}.mp4")
@@ -270,8 +270,9 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
270
 
271
  if __name__ == "__main__":
272
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
 
273
  try:
274
- pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
275
  except:
276
  pass
277
- demo.launch()
 
119
  "cfg_strength": slat_guidance_strength,
120
  },
121
  )
122
+ video = render_utils.render_video(outputs['gaussian'][0], num_frames=20)['color']
123
+ video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=20)['normal']
124
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
125
  trial_id = str(uuid.uuid4())
126
  video_path = os.path.join(user_dir, f"{trial_id}.mp4")
 
270
 
271
  if __name__ == "__main__":
272
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
273
+ pipeline.cuda()
274
  try:
275
+ pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8)))
276
  except:
277
  pass
278
+ demo.launch()