Spaces:
Running
Running
vincent-doan
commited on
Commit
·
2ee69f4
1
Parent(s):
4c757df
Minor change
Browse files- models/SRGAN/srgan.py +2 -2
models/SRGAN/srgan.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
import torch
|
3 |
from torch import nn
|
4 |
from PIL import Image
|
5 |
-
from torchvision.transforms import ToTensor
|
6 |
|
7 |
class ResidualBlock(nn.Module):
|
8 |
def __init__(self, in_features):
|
@@ -62,7 +62,7 @@ class GeneratorResnet(nn.Module):
|
|
62 |
x = ToTensor()(x).unsqueeze(0)
|
63 |
x = self.forward(x)
|
64 |
x = Image.fromarray((x.squeeze(0).permute(1, 2, 0).detach().numpy() * 255).astype('uint8'))
|
65 |
-
return x
|
66 |
|
67 |
if __name__ == '__main__':
|
68 |
current_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
2 |
import torch
|
3 |
from torch import nn
|
4 |
from PIL import Image
|
5 |
+
from torchvision.transforms import ToTensor, functional as TF
|
6 |
|
7 |
class ResidualBlock(nn.Module):
|
8 |
def __init__(self, in_features):
|
|
|
62 |
x = ToTensor()(x).unsqueeze(0)
|
63 |
x = self.forward(x)
|
64 |
x = Image.fromarray((x.squeeze(0).permute(1, 2, 0).detach().numpy() * 255).astype('uint8'))
|
65 |
+
return TF.adjust_brightness(x, 1.1)
|
66 |
|
67 |
if __name__ == '__main__':
|
68 |
current_dir = os.path.dirname(os.path.realpath(__file__))
|