[1] [Handwritten Chinese Font Generation with Collaborative Stroke Refinement]之数据增长实现
版权归属:
更多关注:
1.原理
《Handwritten Chinese Font Generation with Collaborative Stroke Refinement》arxiv.org/abs/1904.13268
文中网络架构图如下:
图中的online zoom-augmentation
是实现网络训练时,对输入数据进行水平
和垂直
方向上的transform
2.编码实现
def hv_transform(self, image):
'''
'''
orig_shp = image.shape
image = tf.cast(image, tf.float32)
rd = tf.random.uniform([])
less_than_025 = tf.less(rd, tf.constant(0.25))
less_than_050 = tf.less(rd, tf.constant(0.50))
less_than_075 = tf