2019-08-23 13:42:47 +00:00
|
|
|
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
|
2020-04-24 06:00:46 +00:00
|
|
|
elif model == 'srgan' or model == 'corruptgan': # GAN-based super resolution(SRGAN / ESRGAN), or corruption use same logic
|
2019-08-23 13:42:47 +00:00
|
|
|
from .SRGAN_model import SRGANModel as M
|
|
|
|
# video restoration
|
|
|
|
elif model == 'video_base':
|
|
|
|
from .Video_base_model import VideoBaseModel 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
|