zi2zi | Learning Chinese Character style with conditional GAN | Machine Learning library
kandi X-RAY | zi2zi Summary
kandi X-RAY | zi2zi Summary
Learning eastern asian language typefaces with GAN. zi2zi(字到字, meaning from character to character) is an application and extension of the recent popular pix2pix model to Chinese characters. Details could be found in this blog post.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build the model
- Compute the fc
- 2d convolutional convolution layer
- Compute discriminator
- Convert a font to an image
- Draw a single character
- Draw an example
- Generate a set of recurring hashes
- Train the model
- Return an iterator over training examples
- Normalize an image
- Get a batch of examples
- Interpolate between two variables
- Retrieve a list of tf trainable variables
- Get an iterable of examples
- Infer embedding
- Get random embedding embedding
- Pickle examples
- Load global charset
- Compile PNG images to a gif file
- Exports the generator
zi2zi Key Features
zi2zi Examples and Code Snippets
##########################
## PreProcess
##########################
# Sample draw the fonts and save to paired_images, about 10-20 mins
PYTHONPATH=. python font2img.py
##########################
## Train and Infer
##########################
# Tra
def conditional_batchnorm(x, train_phase, scope_bn, y=None, nums_class=10):
#Batch Normalization
#Ioffe S, Szegedy C. Batch normalization: accelerating deep network training by reducing internal covariate shift[J]. 2015:448-456.
with tf.v
Font2Font
| README.md
└── src/
| └── zi2zi/ # original zi2zi with data aug options
| └── zi2zi_hir/ # + combine levels of features
| └── zi2zi_hir_dis/ # + increase discriminator complexity
| └── zi2zi_hir_morefilter/ # + alternative way
Community Discussions
Trending Discussions on zi2zi
QUESTION
zi2zi, a Chinese alphabet generating GAN uses pix2pix for generating images. I also have seen many other applications using pix2pix for tasks that aren't related to image-to image translation. I compared the code of zi2zi with regular pix2pix, and found some implementation that I couldn't understand.
What is the target source and where is the random noise? Unlike image-to-image translation tasks where there exists an obvious target image, what is supposed to be the target source for character generation?
Suppose the output of the encoder portion of the unet is the latent space, then how are we supposed to set the latent space to a certain value for evaluation, exploration of the latent space while the decoder is effected by skip-connections of the encoder network?
I want to ask how pix2pix generalizes with these types of problems pix2pix isn't meant to be a powerful solution.
ANSWER
Answered 2021-Jan-12 at 14:36After digging in the code for a few hours I discovered how zi2zi utilizes the pix2pix methodology. If I am correct, the data is split into two parts: real_A
and real_B
. real_A
is fed into the generator along with the class label embedding_ids
and produces fake_b
. The discriminator then aims at discriminating a fake_b
and real_b
with real_a
as the target image.
Conclusively, this seemingly works like an autoencoder, but with the discriminator as an evaluation metric. In concept, there isn't much that is a difference between pix2pix and other GANs with encoders.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install zi2zi
You can use zi2zi like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page