Kev09 commited on
Commit
9dcbc92
1 Parent(s): fc63b42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -42,13 +42,15 @@ def transformation(image):
42
  ImageLoader.save_compare(inputs, preds, 'scaleed_2x_compare.png')
43
  print("ok2")
44
  #prednumpy=preds.detach().numpy()
45
- prednumpy=T.ToPILImage()(preds)
46
- print('pnump',type(prednumpy))
 
 
47
  print('predtype',type(preds))
48
  print('ok3')
49
  # prednumpy = np.squeeze(prednumpy)
50
 
51
- return prednumpy
52
 
53
 
54
 
 
42
  ImageLoader.save_compare(inputs, preds, 'scaleed_2x_compare.png')
43
  print("ok2")
44
  #prednumpy=preds.detach().numpy()
45
+ preds = preds.data.cpu().numpy()
46
+ pred = preds[0].transpose((1, 2, 0)) * 255.0
47
+ # return Image.fromarray(pred.astype('uint8'), 'RGB')
48
+ # print('pnump',type(prednumpy))
49
  print('predtype',type(preds))
50
  print('ok3')
51
  # prednumpy = np.squeeze(prednumpy)
52
 
53
+ return Image.fromarray(pred.astype('uint8'), 'RGB')
54
 
55
 
56