rlawjdghek commited on
Commit
558aa40
β€’
1 Parent(s): 70891b8
Files changed (2) hide show
  1. app.py +3 -0
  2. utils_stableviton.py +1 -1
app.py CHANGED
@@ -14,6 +14,8 @@ import torch
14
  from omegaconf import OmegaConf
15
  from PIL import Image
16
  import spaces
 
 
17
 
18
  from cldm.model import create_model
19
  from cldm.plms_hacked import PLMSSampler
@@ -172,6 +174,7 @@ def process_hd(vton_img, garm_img, n_steps, is_custom):
172
  vton_img = vton_img.resize((IMG_W, IMG_H)) # size for densepose
173
  densepose = densepose_model_hd.execute(vton_img) # densepose
174
  print('%.2fs' % (time.time() - stt))
 
175
 
176
  batch = get_batch(
177
  vton_img,
 
14
  from omegaconf import OmegaConf
15
  from PIL import Image
16
  import spaces
17
+ print(torch.cuda.is_available(), torch.cuda.device_count())
18
+
19
 
20
  from cldm.model import create_model
21
  from cldm.plms_hacked import PLMSSampler
 
174
  vton_img = vton_img.resize((IMG_W, IMG_H)) # size for densepose
175
  densepose = densepose_model_hd.execute(vton_img) # densepose
176
  print('%.2fs' % (time.time() - stt))
177
+ breakpoint()
178
 
179
  batch = get_batch(
180
  vton_img,
utils_stableviton.py CHANGED
@@ -176,7 +176,7 @@ def get_tensor(img, h, w, is_mask=False):
176
  img = (img / 127.5) - 1.0
177
  else:
178
  img = (img < 128).astype(np.float32)[:,:,None]
179
- return torch.from_numpy(img)[None]
180
 
181
  def get_batch(image, cloth, densepose, agn_img, agn_mask, img_h, img_w):
182
  batch = dict()
 
176
  img = (img / 127.5) - 1.0
177
  else:
178
  img = (img < 128).astype(np.float32)[:,:,None]
179
+ return torch.from_numpy(img)[None].cuda()
180
 
181
  def get_batch(image, cloth, densepose, agn_img, agn_mask, img_h, img_w):
182
  batch = dict()