aiqtech commited on
Commit
ac25942
ยท
verified ยท
1 Parent(s): 7d57d13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -234,7 +234,6 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
234
  # ํŒŒ์ดํ”„๋ผ์ธ์„ GPU๋กœ ์ด๋™
235
  g.trellis_pipeline.to('cuda')
236
 
237
- # batch_size ์ œ๊ฑฐํ•˜๊ณ  ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜์ •
238
  outputs = g.trellis_pipeline.run(
239
  image,
240
  seed=seed,
@@ -266,9 +265,12 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
266
  resolution=384
267
  )['normal']
268
 
269
- # CPU๋กœ ๋ฐ์ดํ„ฐ ์ด๋™ ๋ฐ ๋ฉ”๋ชจ๋ฆฌ ์ •๋ฆฌ
270
- video = [v.cpu().numpy() for v in video]
271
- video_geo = [v.cpu().numpy() for v in video_geo]
 
 
 
272
  clear_gpu_memory()
273
 
274
  # ๋น„๋””์˜ค ์ƒ์„ฑ ๋ฐ ์ €์žฅ
 
234
  # ํŒŒ์ดํ”„๋ผ์ธ์„ GPU๋กœ ์ด๋™
235
  g.trellis_pipeline.to('cuda')
236
 
 
237
  outputs = g.trellis_pipeline.run(
238
  image,
239
  seed=seed,
 
265
  resolution=384
266
  )['normal']
267
 
268
+ # tensor๋ฅผ numpy๋กœ ๋ณ€ํ™˜
269
+ if torch.is_tensor(video[0]):
270
+ video = [v.cpu().numpy() if torch.is_tensor(v) else v for v in video]
271
+ if torch.is_tensor(video_geo[0]):
272
+ video_geo = [v.cpu().numpy() if torch.is_tensor(v) else v for v in video_geo]
273
+
274
  clear_gpu_memory()
275
 
276
  # ๋น„๋””์˜ค ์ƒ์„ฑ ๋ฐ ์ €์žฅ