def __init__(self, texture_imgs, model, gpu, optimizer, content_weight=1, texture_weight=1):
"""
:type converter: multi_reference_image_converter.MultiReferenceImageConverter
"""
self.converter = neural_art.image_converters.MultiReferenceImageConverter(
texture_imgs, gpu=gpu, content_weight=content_weight, texture_weight=1, model=model, average_pooling=True)
self.model = model
self.optimizer = optimizer
self.content_weight = content_weight
self.texture_weight = texture_weight
if gpu >= 0:
chainer.cuda.get_device(gpu).use()
self.xp = chainer.cuda.cupy
self.model.model.to_gpu()
else:
self.xp = numpy
large_image_converter.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录