2020-11-15 18:26:44 +00:00
|
|
|
|
|
|
|
def create_stylegan2_loss(opt_loss, env):
|
|
|
|
type = opt_loss['type']
|
|
|
|
if type == 'stylegan2_divergence':
|
2023-03-21 15:39:28 +00:00
|
|
|
import dlas.models.image_generation.stylegan.stylegan2_lucidrains as stylegan2
|
2020-11-15 18:32:35 +00:00
|
|
|
return stylegan2.StyleGan2DivergenceLoss(opt_loss, env)
|
2020-11-15 18:26:44 +00:00
|
|
|
elif type == 'stylegan2_pathlen':
|
2023-03-21 15:39:28 +00:00
|
|
|
import dlas.models.image_generation.stylegan.stylegan2_lucidrains as stylegan2
|
2020-11-15 18:32:35 +00:00
|
|
|
return stylegan2.StyleGan2PathLengthLoss(opt_loss, env)
|
2020-11-15 18:26:44 +00:00
|
|
|
else:
|
2023-03-21 15:39:28 +00:00
|
|
|
raise NotImplementedError
|