Skip to content

Instantly share code, notes, and snippets.

@tc87
Last active March 31, 2020 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tc87/c6292bfa778fb5a2695325d47ce198b3 to your computer and use it in GitHub Desktop.
Save tc87/c6292bfa778fb5a2695325d47ce198b3 to your computer and use it in GitHub Desktop.
def main():
st.title("Streamlit Face-GAN Demo")
# Step 1. Download models and data files.
for filename in EXTERNAL_DEPENDENCIES.keys():
download_file(filename)
# Step 2. Read in models from the data files.
tl_gan_model, feature_names = load_tl_gan_model()
session, pg_gan_model = load_pg_gan_model()
# Step 3. Draw the sidebar UI.
...
features = ... # Internally, this uses st.sidebar.slider(), etc.
# Step 4. Synthesize the image.
with session.as_default():
image_out = generate_image(session, pg_gan_model, tl_gan_model,
features, feature_names)
# Step 5. Draw the synthesized image.
st.image(image_out, use_column_width=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment