diff options
| author | tingchunw <tingchunw@nvidia.com> | 2017-12-06 05:11:15 +0000 |
|---|---|---|
| committer | tingchunw <tingchunw@nvidia.com> | 2017-12-06 05:11:15 +0000 |
| commit | ff819925c6f8c9c22f0c2a31559d8c468d40ec19 (patch) | |
| tree | 40d69ea5fb292be51628e95460a14bb38661ccc1 | |
| parent | d101ebf83288b7dc994118ee6dd8857583beaecb (diff) | |
remove unnecessary imports
| -rwxr-xr-x | data/aligned_dataset.py | 4 | ||||
| -rwxr-xr-x | data/image_folder.py | 3 | ||||
| -rwxr-xr-x | encode_features.py | 4 | ||||
| -rwxr-xr-x | models/networks.py | 4 | ||||
| -rwxr-xr-x | models/pix2pixHD_model.py | 2 | ||||
| -rwxr-xr-x | precompute_feature_maps.py | 3 | ||||
| -rwxr-xr-x | test.py | 1 | ||||
| -rwxr-xr-x | util/image_pool.py | 1 | ||||
| -rwxr-xr-x | util/util.py | 3 |
9 files changed, 2 insertions, 23 deletions
diff --git a/data/aligned_dataset.py b/data/aligned_dataset.py index 50390f3..a0c9a0a 100755 --- a/data/aligned_dataset.py +++ b/data/aligned_dataset.py @@ -1,13 +1,9 @@ ### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. ### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). import os.path -import random -import torchvision.transforms as transforms -import torch from data.base_dataset import BaseDataset, get_params, get_transform, normalize from data.image_folder import make_dataset from PIL import Image -import numpy as np class AlignedDataset(BaseDataset): def initialize(self, opt): diff --git a/data/image_folder.py b/data/image_folder.py index 16a447c..df0141f 100755 --- a/data/image_folder.py +++ b/data/image_folder.py @@ -4,12 +4,9 @@ # Modified the original code so that it also loads images from the current # directory as well as the subdirectories ############################################################################### - import torch.utils.data as data - from PIL import Image import os -import os.path IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', diff --git a/encode_features.py b/encode_features.py index 0e97da8..8437264 100755 --- a/encode_features.py +++ b/encode_features.py @@ -4,9 +4,7 @@ from options.train_options import TrainOptions from data.data_loader import CreateDataLoader
from models.models import create_model
import numpy as np
-import os, time
-import util.util as util
-from torch.autograd import Variable
+import os
opt = TrainOptions().parse()
opt.nThreads = 1
diff --git a/models/networks.py b/models/networks.py index a673a56..c583b99 100755 --- a/models/networks.py +++ b/models/networks.py @@ -2,13 +2,9 @@ ### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). import torch import torch.nn as nn -from torch.nn import init import functools from torch.autograd import Variable import numpy as np -import math -import torch.nn.functional as F -import copy ############################################################################### # Functions diff --git a/models/pix2pixHD_model.py b/models/pix2pixHD_model.py index ba44e53..fea9a1d 100755 --- a/models/pix2pixHD_model.py +++ b/models/pix2pixHD_model.py @@ -3,9 +3,7 @@ import numpy as np import torch import os -from collections import OrderedDict from torch.autograd import Variable -import util.util as util from util.image_pool import ImagePool from .base_model import BaseModel from . import networks diff --git a/precompute_feature_maps.py b/precompute_feature_maps.py index a631b9c..d7fe418 100755 --- a/precompute_feature_maps.py +++ b/precompute_feature_maps.py @@ -3,8 +3,7 @@ from options.train_options import TrainOptions
from data.data_loader import CreateDataLoader
from models.models import create_model
-import numpy as np
-import os, time
+import os
import util.util as util
from torch.autograd import Variable
import torch.nn as nn
@@ -1,6 +1,5 @@ ### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. ### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). -import time import os from collections import OrderedDict from options.test_options import TestOptions diff --git a/util/image_pool.py b/util/image_pool.py index 152ef5b..63e1877 100755 --- a/util/image_pool.py +++ b/util/image_pool.py @@ -1,5 +1,4 @@ import random -import numpy as np import torch from torch.autograd import Variable class ImagePool(): diff --git a/util/util.py b/util/util.py index 0898f7a..7da22a9 100755 --- a/util/util.py +++ b/util/util.py @@ -4,11 +4,8 @@ from __future__ import print_function import torch import numpy as np from PIL import Image -import inspect, re import numpy as np import os -import collections -from PIL import Image # Converts a Tensor into a Numpy array # |imtype|: the desired type of the converted numpy array |
