Skip to content

Commit

Permalink
Update: Replace the MEAN and STD params in dataset.
Browse files Browse the repository at this point in the history
  • Loading branch information
chairc committed Nov 22, 2024
1 parent 12ed0df commit c285830
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sr/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PIL import Image
from torch.utils.data import Dataset, DataLoader, DistributedSampler

from config.setting import MEAN, STD
from config.setting import SR_MEAN, SR_STD


class SRDataset(Dataset):
Expand All @@ -28,7 +28,7 @@ def __init__(self, image_size=64, dataset_path="", scale=4):
# To Tensor Format
torchvision.transforms.ToTensor(),
# For standardization, the mean and standard deviation
torchvision.transforms.Normalize(mean=MEAN, std=STD)
torchvision.transforms.Normalize(mean=SR_MEAN, std=SR_STD)
])
self.hr_transforms = torchvision.transforms.Compose([
# Resize input size
Expand All @@ -37,7 +37,7 @@ def __init__(self, image_size=64, dataset_path="", scale=4):
# To Tensor Format
torchvision.transforms.ToTensor(),
# For standardization, the mean and standard deviation
torchvision.transforms.Normalize(mean=MEAN, std=STD)
torchvision.transforms.Normalize(mean=SR_MEAN, std=SR_STD)
])

def __getitem__(self, index):
Expand Down

0 comments on commit c285830

Please sign in to comment.