readme: ---
  license: apache-2.0
  library_name: keras 
  tags:
  - dcgan 
  datasets:
  - merve/anime-faces
  ---
  ## Model description
  Anime face generator model using [TensorFlow DCGAN example](https://www.tensorflow.org/tutorials/generative/dcgan).
  
  ## Training and evaluation data
  Model is trained on [anime faces dataset](https://huggingface.co/datasets/merve/anime-faces). The dataset consists of 21551 anime faces scraped from www.getchu.com, which are then cropped using the anime face detection algorithm [here](https://github.com/nagadomi/lbpcascade_animeface). All images are resized to 64 * 64 for the sake of convenience. The model takes a noise as input and then Conv2DTranspose is used to do upsampling. If you want to pass this to another discriminator, the output shape consists of 28x28 images.
  
  ## How to use this model
  You can use this model to generate new anime faces. If you want to continuously train, use with [discriminator](https://huggingface.co/merve/anime-faces-discriminator) using `tf.GradientTape()` as mentioned in the DCGAN tutorial.
  
  ```
  from huggingface_hub import from_pretrained_keras
  
  model = from_pretrained_keras("merve/anime-faces-generator")
  ```
  
  You can generate examples using a noise.
  
  ```
  seed = tf.random.normal([number_of_examples_to_generate, noise])
  predictions = model(seed, training=False) # inference mode
  ```
  ## Intended use and biases
  This model is not intended for production.
  
  ### Generated images 
  ![Example](./example.png)