Last active
March 31, 2020 15:37
-
-
Save tc87/c6292bfa778fb5a2695325d47ce198b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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