aiqtech commited on
Commit
150c6e2
·
verified ·
1 Parent(s): 9c4daaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -153,12 +153,11 @@ def unpack_state(state: dict) -> Tuple[Gaussian, edict, str]:
153
 
154
  return gs, mesh, state['trial_id']
155
 
156
-
157
  @spaces.GPU
158
  def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_strength: float, ss_sampling_steps: int, slat_guidance_strength: float, slat_sampling_steps: int) -> Tuple[dict, str]:
159
  if randomize_seed:
160
  seed = np.random.randint(0, MAX_SEED)
161
- outputs = pipeline.run(
162
  Image.open(f"{TMP_DIR}/{trial_id}.png"),
163
  seed=seed,
164
  formats=["gaussian", "mesh"],
@@ -172,6 +171,7 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
172
  "cfg_strength": slat_guidance_strength,
173
  },
174
  )
 
175
  video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
176
  video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
177
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
 
153
 
154
  return gs, mesh, state['trial_id']
155
 
 
156
  @spaces.GPU
157
  def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_strength: float, ss_sampling_steps: int, slat_guidance_strength: float, slat_sampling_steps: int) -> Tuple[dict, str]:
158
  if randomize_seed:
159
  seed = np.random.randint(0, MAX_SEED)
160
+ outputs = g.trellis_pipeline.run( # pipeline을 g.trellis_pipeline으로 수정
161
  Image.open(f"{TMP_DIR}/{trial_id}.png"),
162
  seed=seed,
163
  formats=["gaussian", "mesh"],
 
171
  "cfg_strength": slat_guidance_strength,
172
  },
173
  )
174
+
175
  video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
176
  video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
177
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]