Beasto commited on
Commit
3c638ad
1 Parent(s): 4007ccf

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import tensorflow as tf
3
+ import numpy as np
4
+
5
+ # Load the model
6
+ model = tf.keras.models.load_model('HumanFaceGenerator.h5')
7
+
8
+ # Create a button
9
+ button_clicked = st.button("Generate")
10
+
11
+ # Check if the button is clicked
12
+ if button_clicked:
13
+ # Generate an image
14
+ seed = tf.random.normal((1, 100))
15
+ pred = model.predict(seed)
16
+ pred = pred * 0.5 + 0.5 # Normalize the pixel values
17
+ pred = np.squeeze(pred) # Remove singleton dimensions if any
18
+
19
+ # Display the generated image
20
+ st.image(pred, caption='Generated Image', use_column_width=True)