Spaces:
Sleeping
Sleeping
nishantguvvada
commited on
Commit
·
24bab8a
1
Parent(s):
5c7c640
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
import tensorflow as tf
|
3 |
-
|
|
|
|
|
4 |
|
5 |
-
@st.
|
6 |
def load_model():
|
7 |
model=tf.keras.models.load_model('./hip_impant_model.h5')
|
8 |
return model
|
@@ -15,9 +17,7 @@ st.write("""
|
|
15 |
)
|
16 |
|
17 |
file = st.file_uploader("Upload an X-ray image")
|
18 |
-
|
19 |
-
from PIL import Image, ImageOps
|
20 |
-
import numpy as np
|
21 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|
22 |
def model_prediction(img, model):
|
23 |
resize = tf.image.resize(img, (256,256))
|
|
|
1 |
import streamlit as st
|
2 |
import tensorflow as tf
|
3 |
+
import cv2
|
4 |
+
import numpy as np
|
5 |
+
from PIL import Image, ImageOps
|
6 |
|
7 |
+
@st.cache_resource(allow_output_mutation=True)
|
8 |
def load_model():
|
9 |
model=tf.keras.models.load_model('./hip_impant_model.h5')
|
10 |
return model
|
|
|
17 |
)
|
18 |
|
19 |
file = st.file_uploader("Upload an X-ray image")
|
20 |
+
|
|
|
|
|
21 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|
22 |
def model_prediction(img, model):
|
23 |
resize = tf.image.resize(img, (256,256))
|