Spaces:
Runtime error
Runtime error
Eugene Siow
commited on
Commit
·
16660bd
1
Parent(s):
88231f1
Add fix for output to PIL image.
Browse files
app.py
CHANGED
@@ -46,7 +46,6 @@ def inference(img, scale_str, model_name):
|
|
46 |
preds = model(inputs)
|
47 |
preds = preds.data.cpu().numpy()
|
48 |
pred = preds[0].transpose((1, 2, 0)) * 255.0
|
49 |
-
pred = cv2.cvtColor(pred, cv2.COLOR_BGR2RGB)
|
50 |
return Image.fromarray(pred.astype('uint8'), 'RGB')
|
51 |
|
52 |
|
@@ -56,6 +55,7 @@ torch.hub.download_url_to_file('http://people.rennes.inria.fr/Aline.Roumy/result
|
|
56 |
'woman.bmp')
|
57 |
torch.hub.download_url_to_file('http://people.rennes.inria.fr/Aline.Roumy/results/images_SR_BMVC12/input_groundtruth/bird_mini_d4_gaussian.bmp',
|
58 |
'bird.bmp')
|
|
|
59 |
models = ['EDSR-base', 'DRLN', 'EDSR', 'MSRN', 'MDSR', 'AWSRN-BAM', 'A2N', 'CARN', 'PAN']
|
60 |
scales = [2, 3, 4]
|
61 |
for model_name in models:
|
|
|
46 |
preds = model(inputs)
|
47 |
preds = preds.data.cpu().numpy()
|
48 |
pred = preds[0].transpose((1, 2, 0)) * 255.0
|
|
|
49 |
return Image.fromarray(pred.astype('uint8'), 'RGB')
|
50 |
|
51 |
|
|
|
55 |
'woman.bmp')
|
56 |
torch.hub.download_url_to_file('http://people.rennes.inria.fr/Aline.Roumy/results/images_SR_BMVC12/input_groundtruth/bird_mini_d4_gaussian.bmp',
|
57 |
'bird.bmp')
|
58 |
+
|
59 |
models = ['EDSR-base', 'DRLN', 'EDSR', 'MSRN', 'MDSR', 'AWSRN-BAM', 'A2N', 'CARN', 'PAN']
|
60 |
scales = [2, 3, 4]
|
61 |
for model_name in models:
|