Spaces:
Runtime error
Runtime error
Update models/test_model.py
Browse files- models/test_model.py +0 -7
models/test_model.py
CHANGED
|
@@ -5,20 +5,16 @@ from . import networks
|
|
| 5 |
class TestModel(BaseModel):
|
| 6 |
""" This TesteModel can be used to generate CycleGAN results for only one direction.
|
| 7 |
This model will automatically set '--dataset_mode single', which only loads the images from one collection.
|
| 8 |
-
|
| 9 |
See the test instruction for more details.
|
| 10 |
"""
|
| 11 |
@staticmethod
|
| 12 |
def modify_commandline_options(parser, is_train=True):
|
| 13 |
"""Add new dataset-specific options, and rewrite default values for existing options.
|
| 14 |
-
|
| 15 |
Parameters:
|
| 16 |
parser -- original option parser
|
| 17 |
is_train (bool) -- whether training phase or test phase. You can use this flag to add training-specific or test-specific options.
|
| 18 |
-
|
| 19 |
Returns:
|
| 20 |
the modified parser.
|
| 21 |
-
|
| 22 |
The model can only be used during test time. It requires '--dataset_mode single'.
|
| 23 |
You need to specify the network using the option '--model_suffix'.
|
| 24 |
"""
|
|
@@ -30,7 +26,6 @@ class TestModel(BaseModel):
|
|
| 30 |
|
| 31 |
def __init__(self, opt):
|
| 32 |
"""Initialize the pix2pix class.
|
| 33 |
-
|
| 34 |
Parameters:
|
| 35 |
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
|
| 36 |
"""
|
|
@@ -51,10 +46,8 @@ class TestModel(BaseModel):
|
|
| 51 |
|
| 52 |
def set_input(self, input):
|
| 53 |
"""Unpack input data from the dataloader and perform necessary pre-processing steps.
|
| 54 |
-
|
| 55 |
Parameters:
|
| 56 |
input: a dictionary that contains the data itself and its metadata information.
|
| 57 |
-
|
| 58 |
We need to use 'single_dataset' dataset mode. It only load images from one domain.
|
| 59 |
"""
|
| 60 |
self.real = input['A'].to(self.device)
|
|
|
|
| 5 |
class TestModel(BaseModel):
|
| 6 |
""" This TesteModel can be used to generate CycleGAN results for only one direction.
|
| 7 |
This model will automatically set '--dataset_mode single', which only loads the images from one collection.
|
|
|
|
| 8 |
See the test instruction for more details.
|
| 9 |
"""
|
| 10 |
@staticmethod
|
| 11 |
def modify_commandline_options(parser, is_train=True):
|
| 12 |
"""Add new dataset-specific options, and rewrite default values for existing options.
|
|
|
|
| 13 |
Parameters:
|
| 14 |
parser -- original option parser
|
| 15 |
is_train (bool) -- whether training phase or test phase. You can use this flag to add training-specific or test-specific options.
|
|
|
|
| 16 |
Returns:
|
| 17 |
the modified parser.
|
|
|
|
| 18 |
The model can only be used during test time. It requires '--dataset_mode single'.
|
| 19 |
You need to specify the network using the option '--model_suffix'.
|
| 20 |
"""
|
|
|
|
| 26 |
|
| 27 |
def __init__(self, opt):
|
| 28 |
"""Initialize the pix2pix class.
|
|
|
|
| 29 |
Parameters:
|
| 30 |
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
|
| 31 |
"""
|
|
|
|
| 46 |
|
| 47 |
def set_input(self, input):
|
| 48 |
"""Unpack input data from the dataloader and perform necessary pre-processing steps.
|
|
|
|
| 49 |
Parameters:
|
| 50 |
input: a dictionary that contains the data itself and its metadata information.
|
|
|
|
| 51 |
We need to use 'single_dataset' dataset mode. It only load images from one domain.
|
| 52 |
"""
|
| 53 |
self.real = input['A'].to(self.device)
|