Shuang59 commited on
Commit
3f591a2
β€’
1 Parent(s): 46ad0fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -195,7 +195,8 @@ def compose_language_descriptions(prompt, guidance_scale):
195
 
196
  out_img = upsamples[0].permute(1,2,0)
197
  out_img = (out_img+1)/2
198
- out_img = np.array(out_img.data.to('cpu'))
 
199
  return out_img
200
 
201
  # create model for CLEVR Objects
@@ -269,7 +270,8 @@ def compose_clevr_objects(prompt, guidance_scale):
269
  samples = sample(coordinates)
270
  out_img = samples[0].permute(1,2,0)
271
  out_img = (out_img+1)/2
272
- out_img = np.array(out_img.data.to('cpu'))
 
273
  return out_img
274
 
275
 
 
195
 
196
  out_img = upsamples[0].permute(1,2,0)
197
  out_img = (out_img+1)/2
198
+ out_img = (out_img.detach().cpu() * 255.).to(torch.uint8)
199
+ out_img = out_img.numpy()
200
  return out_img
201
 
202
  # create model for CLEVR Objects
 
270
  samples = sample(coordinates)
271
  out_img = samples[0].permute(1,2,0)
272
  out_img = (out_img+1)/2
273
+ out_img = (out_img.detach().cpu() * 255.).to(torch.uint8)
274
+ out_img = out_img.numpy()
275
  return out_img
276
 
277