Spaces:
Sleeping
Sleeping
bracken576
commited on
Commit
·
1f85d6b
1
Parent(s):
a702025
updated streamlit and requirements
Browse files- streamlit.py +3 -7
streamlit.py
CHANGED
|
@@ -7,20 +7,16 @@ import tensorflow as tf
|
|
| 7 |
from keras.preprocessing import image
|
| 8 |
#docker build -t streamlit
|
| 9 |
# docker compose up
|
| 10 |
-
|
| 11 |
model = tf.keras.models.load_model("cnnBoneFracRec.h5")
|
| 12 |
st.markdown("## Bone Fracture Recognition with TensorFlow")
|
| 13 |
|
| 14 |
|
| 15 |
-
|
| 16 |
-
# actu_loc = [actu + f"_{loc}" for loc in locations]
|
| 17 |
-
# fore_loc = [fore + f"_{loc}" for loc in locations]
|
| 18 |
-
|
| 19 |
image_file = st.file_uploader("Upload X-Ray Image", type=['png', 'jpg'])
|
| 20 |
|
| 21 |
-
if image_file:
|
| 22 |
st.image(image_file, caption=None, width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto")
|
| 23 |
-
|
| 24 |
target_names = ['Non-Fractured', 'Fractured']
|
| 25 |
temp_img = image.load_img(image_file, target_size=(100, 100))
|
| 26 |
x = image.img_to_array(temp_img)
|
|
|
|
| 7 |
from keras.preprocessing import image
|
| 8 |
#docker build -t streamlit
|
| 9 |
# docker compose up
|
| 10 |
+
image_file_prev = ""
|
| 11 |
model = tf.keras.models.load_model("cnnBoneFracRec.h5")
|
| 12 |
st.markdown("## Bone Fracture Recognition with TensorFlow")
|
| 13 |
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
image_file = st.file_uploader("Upload X-Ray Image", type=['png', 'jpg'])
|
| 16 |
|
| 17 |
+
if image_file_prev != image_file and image_file:
|
| 18 |
st.image(image_file, caption=None, width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto")
|
| 19 |
+
image_file_prev = image_file
|
| 20 |
target_names = ['Non-Fractured', 'Fractured']
|
| 21 |
temp_img = image.load_img(image_file, target_size=(100, 100))
|
| 22 |
x = image.img_to_array(temp_img)
|