File size: 580 Bytes
3c638ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import streamlit as st
import tensorflow as tf 
import numpy as np

# Load the model
model = tf.keras.models.load_model('HumanFaceGenerator.h5')

# Create a button
button_clicked = st.button("Generate")

# Check if the button is clicked
if button_clicked:
    # Generate an image
    seed = tf.random.normal((1, 100))
    pred = model.predict(seed)
    pred = pred * 0.5 + 0.5  # Normalize the pixel values
    pred = np.squeeze(pred)  # Remove singleton dimensions if any
    
    # Display the generated image
    st.image(pred, caption='Generated Image', use_column_width=True)