Skip to content

Commit

Permalink
remove unused file
Browse files Browse the repository at this point in the history
  • Loading branch information
junyanz committed Jul 31, 2020
1 parent b174432 commit 5ac8395
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 163 deletions.
5 changes: 2 additions & 3 deletions data/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, opt):
self.opt = opt
self.root = opt.dataroot
self.current_epoch = 0

@staticmethod
def modify_commandline_options(parser, is_train):
"""Add new dataset-specific options, and rewrite default values for existing options.
Expand Down Expand Up @@ -112,10 +113,9 @@ def get_transform(opt, params=None, grayscale=False, method=Image.BICUBIC, conve
if 'trim' in opt.preprocess:
transform_list.append(transforms.Lambda(lambda img: __trim(img, opt.crop_size)))

#if opt.preprocess == 'none':
# if opt.preprocess == 'none':
transform_list.append(transforms.Lambda(lambda img: __make_power_2(img, base=4, method=method)))


if not opt.no_flip:
if params is None or 'flip' not in params:
transform_list.append(transforms.RandomHorizontalFlip())
Expand All @@ -138,7 +138,6 @@ def __make_power_2(img, base, method=Image.BICUBIC):
if h == oh and w == ow:
return img

#__print_size_warning(ow, oh, w, h)
return img.resize((w, h), method)


Expand Down
158 changes: 0 additions & 158 deletions data/singleimage_dataset.py

This file was deleted.

4 changes: 2 additions & 2 deletions util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)


def correct_resize_label(t, size):
device = t.device
t = t.detach().cpu()
Expand All @@ -158,9 +159,8 @@ def correct_resize(t, size, mode=Image.BICUBIC):
t = t.detach().cpu()
resized = []
for i in range(t.size(0)):
one_t = t[i:i+1]
one_t = t[i:i + 1]
one_image = Image.fromarray(tensor2im(one_t)).resize(size, Image.BICUBIC)
resized_t = torchvision.transforms.functional.to_tensor(one_image) * 2 - 1.0
resized.append(resized_t)
return torch.stack(resized, dim=0).to(device)

0 comments on commit 5ac8395

Please sign in to comment.