Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Corrected height and width in cityscapes loader. #38

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dataloaders/CityscapesDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def list_images(self):
def transforms(self, image, label):
assert image.size == label.size
# resize
new_width, new_height = (int(self.opt.load_size / self.opt.aspect_ratio), self.opt.load_size)
image = TR.functional.resize(image, (new_width, new_height), Image.BICUBIC)
label = TR.functional.resize(label, (new_width, new_height), Image.NEAREST)
new_height, new_width = (int(self.opt.load_size / self.opt.aspect_ratio), self.opt.load_size)
image = TR.functional.resize(image, (new_height, new_width), Image.BICUBIC)
label = TR.functional.resize(label, (new_height, new_width), Image.NEAREST)
# flip
if not (self.opt.phase == "test" or self.opt.no_flip or self.for_metrics):
if random.random() < 0.5:
Expand Down