basso4 commited on
Commit
4c79106
1 Parent(s): 5f374d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -81,16 +81,16 @@ if __name__ == "__main__":
81
 
82
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
83
 
84
- # model = instantiate_from_config(config.model)
85
- # model.load_state_dict(torch.load(opt.ckpt, map_location="cpu")["state_dict"], strict=False)
86
- # model.cuda()
87
- # model.eval()
88
- # model = model.to(device)
89
- # sampler = DDIMSampler(model)
90
 
91
  precision_scope = autocast
92
 
93
- # @spaces.GPU
94
  def start_tryon(human_img,garm_img):
95
  #load human image
96
  human_img = human_img['background'].convert("RGB").resize((768,1024))
 
81
 
82
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
83
 
84
+ model = instantiate_from_config(config.model)
85
+ model.load_state_dict(torch.load(opt.ckpt, map_location="cpu")["state_dict"], strict=False)
86
+ model.cuda()
87
+ model.eval()
88
+ model = model.to(device)
89
+ sampler = DDIMSampler(model)
90
 
91
  precision_scope = autocast
92
 
93
+ @spaces.GPU
94
  def start_tryon(human_img,garm_img):
95
  #load human image
96
  human_img = human_img['background'].convert("RGB").resize((768,1024))