-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstreamlit_app.py
More file actions
33 lines (26 loc) · 944 Bytes
/
streamlit_app.py
File metadata and controls
33 lines (26 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import streamlit as st
import pandas as pd
from PIL import Image
import numpy as np
from pytorch_prediction_pokemon_api import get_prediction
##########################################
# WEB PAGE CONTENT
##########################################
# web page ico and tab title
st.set_page_config(
page_title='PykaDex API',
page_icon='./assets/icon.ico'
)
# page header
st.image('./assets/icon.png',width=80)
st.title('PykaDex API')
st.markdown("See full project on [GitHub](https://github.com/PykaDex)")
uploaded_image = st.file_uploader('',type=[ "jpg", "jpeg","png"])
submit_button = st.button("Scan Pokemon")
if uploaded_image is not None:
image = Image.open(uploaded_image)
st.image(image, caption='Uploaded Image', use_column_width=True)
if submit_button:
with st.spinner('Model working....'):
predictions = get_prediction(image)
st.markdown(predictions)