forked from mrq/DL-Art-School
f894ba8f98
This is a port from the SPSR repo, it's going to need a lot of work to be properly integrated but as of this commit it at least runs.
21 lines
741 B
Python
21 lines
741 B
Python
import logging
|
|
logger = logging.getLogger('base')
|
|
|
|
|
|
def create_model(opt):
|
|
model = opt['model']
|
|
# image restoration
|
|
if model == 'sr': # PSNR-oriented super resolution
|
|
from .SR_model import SRModel as M
|
|
elif model == 'srgan' or model == 'corruptgan': # GAN-based super resolution(SRGAN / ESRGAN), or corruption use same logic
|
|
from .SRGAN_model import SRGANModel as M
|
|
elif model == 'feat':
|
|
from .feature_model import FeatureModel as M
|
|
if model == 'spsr':
|
|
from .SPSR_model import SPSRModel as M
|
|
else:
|
|
raise NotImplementedError('Model [{:s}] not recognized.'.format(model))
|
|
m = M(opt)
|
|
logger.info('Model [{:s}] is created.'.format(m.__class__.__name__))
|
|
return m
|