Spaces:
Sleeping
Sleeping
Commit
·
bb77bdd
1
Parent(s):
3647672
Update app.py
Browse files
app.py
CHANGED
@@ -1,59 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import tensorflow as tf
|
3 |
from PIL import Image
|
4 |
-
# from src.utils import *
|
5 |
-
# from src.vertex import *
|
6 |
-
|
7 |
-
st.set_page_config(
|
8 |
-
page_title="Hip-Implant Image Classification",
|
9 |
-
page_icon=":robot:",
|
10 |
-
layout="centered",
|
11 |
-
initial_sidebar_state="expanded",
|
12 |
-
menu_items={
|
13 |
-
'How to use': "# Upload an image of a hip-implant (search <loose hip implant> on google), the app will classify the hip-implant as loose or in-control."
|
14 |
-
}
|
15 |
-
)
|
16 |
-
|
17 |
-
#creating session states
|
18 |
-
create_session_state()
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
# image = Image.open('./image/title.jpg')
|
23 |
-
# st.image(image)
|
24 |
-
st.title(":red[My AI Journey] :blue[Nishant Guvvada] X-ray Assistant")
|
25 |
-
|
26 |
-
with st.sidebar:
|
27 |
-
# image = Image.open('./image/sidebar_image.jpg')
|
28 |
-
# st.image(image)
|
29 |
-
st.markdown("<h2 style='text-align: center; color: red;'>Settings Tab</h2>", unsafe_allow_html=True)
|
30 |
-
|
31 |
-
|
32 |
-
st.write("Model Settings:")
|
33 |
-
|
34 |
-
#define the temeperature for the model
|
35 |
-
temperature_value = st.slider('Temperature :', 0.0, 1.0, 0.2)
|
36 |
-
st.session_state['temperature'] = temperature_value
|
37 |
-
|
38 |
-
#define the temeperature for the model
|
39 |
-
token_limit_value = st.slider('Token limit :', 1, 1024, 256)
|
40 |
-
st.session_state['token_limit'] = token_limit_value
|
41 |
-
|
42 |
-
#define the temeperature for the model
|
43 |
-
top_k_value = st.slider('Top-K :', 1,40,40)
|
44 |
-
st.session_state['top_k'] = top_k_value
|
45 |
-
|
46 |
-
#define the temeperature for the model
|
47 |
-
top_p_value = st.slider('Top-P :', 0.0, 1.0, 0.8)
|
48 |
-
st.session_state['top_p'] = top_p_value
|
49 |
-
|
50 |
-
if st.button("Reset Session"):
|
51 |
-
reset_session()
|
52 |
-
|
53 |
-
|
54 |
-
st.image(bytes_data, caption='User uploaded image')
|
55 |
-
st.balloons()
|
56 |
-
|
57 |
|
58 |
@st.cache(allow_output_mutation=True)
|
59 |
def load_model():
|
|
|
1 |
import streamlit as st
|
2 |
import tensorflow as tf
|
3 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
@st.cache(allow_output_mutation=True)
|
6 |
def load_model():
|