Created
December 29, 2020 09:50
-
-
Save mengwangk/baedbe51cd8136fc85ec6c2465e70008 to your computer and use it in GitHub Desktop.
Serving ML models - PGAN front end
This file contains hidden or 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
| import io | |
| import requests | |
| import streamlit as st | |
| from PIL import Image | |
| server_url=f"http://backend:8088/pgan" | |
| def pgan(): | |
| st.title("PGAN - Progressive Growing of GANS") | |
| st.write( | |
| """Serving PGAN model using FastAPI and Streamlit.""" | |
| ) | |
| if st.button("Generate"): | |
| res = requests.get(server_url) | |
| pgan_image = Image.open(io.BytesIO(res.content)) | |
| col1, col2 = st.beta_columns(2) | |
| col1.header("PGAN Image") | |
| col1.image(pgan_image, use_column_width=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment