MC-GAN:Multi-Content GAN for Few-Shot Font Style Transfer
程序员文章站
2022-03-09 13:35:31
...
MC-GAN:Multi-Content GAN for Few-Shot Font Style Transfer
多内容GAN,可进行少量字体转换
文章下载链接:https://arxiv.org/pdf/1712.00516.pdf
代码地址:https://github.com/azadis/MC-GAN
一、源码
1. 数据集
2. networks.py
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import functools
from torch import index_select, LongTensor
def weights_init(m):
classname = m.__class__.__name__
print "classname",classname
if classname.find('Conv') != -1:
print "in random conv"
m.weight.data.normal_(0.0, 0.02)
if hasattr(m.bias, 'data'):
m.bias.data.fill_