Downloads · 30 days
15
4% of all-time downloads
keras-io/dcgan-to-generate-face-images
dcgan-to-generate-face-images is a machine learning model from keras-io. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for tf-keras.
Downloads · 30 days
15
4% of all-time downloads
All-time downloads
388
Public
Repo size
1.9 MB
Likes
2
Public
Click a slice to open those files.
.data-00000-of-000011.6 MB · 84%
From the Hugging Face model README
This is an example notebook for Keras sprint prepared by Hugging Face. Keras Sprint aims to reproduce Keras examples and build interactive demos to them. The markdown parts beginning with 🤗 and the following code snippets are the parts added by the Hugging Face team to give you an example of how to host your model and build a demo.
Original Author of the DCGAN to generate face images Example: fchollet
discriminator = keras.Sequential(
[
keras.Input(shape=(64, 64, 3)),
layers.Conv2D(64, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Conv2D(128, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Conv2D(128, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Flatten(),
layers.Dropout(0.2),
layers.Dense(1, activation="sigmoid"),
],
name="discriminator",
)
latent_dim = 128
generator = keras.Sequential(
[
keras.Input(shape=(latent_dim,)),
layers.Dense(8 * 8 * 128),
layers.Reshape((8, 8, 128)),
layers.Conv2DTranspose(128, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Conv2DTranspose(256, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Conv2DTranspose(512, kernel_size=4, strides=2, padding="same"),
layers.LeakyReLU(alpha=0.2),
layers.Conv2D(3, kernel_size=5, padding="same", activation="sigmoid"),
],
name="generator",
)
HF Contributor: Tarun Jain