Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
print('predtype',type(preds))
|
| 48 |
print('ok3')
|
| 49 |
# prednumpy = np.squeeze(prednumpy)
|
| 50 |
|
| 51 |
-
return
|
| 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 |
|