Spaces:
Sleeping
Sleeping
bracken576
commited on
Commit
·
20213fc
1
Parent(s):
2d982ae
updated streamlit and requirements
Browse files- streamlit.py +12 -12
streamlit.py
CHANGED
@@ -21,15 +21,15 @@ if image_file:
|
|
21 |
st.image(image_file, caption=None, width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto")
|
22 |
|
23 |
|
24 |
-
model = tf.keras.models.load_model("cnnBoneFracRec.h5")
|
25 |
-
target_names = ['Non-Fractured', 'Fractured']
|
26 |
-
temp_img = image.load_img(image_file, target_size=(100, 100))
|
27 |
-
x = image.img_to_array(temp_img)
|
28 |
-
x = np.expand_dims(x, axis=0)
|
29 |
-
images = np.vstack([x])
|
30 |
-
prediction = np.argmax(model.predict(images), axis=1)
|
31 |
-
|
32 |
-
prediction_str = target_names[prediction.item()]
|
33 |
-
|
34 |
-
if prediction_str:
|
35 |
-
|
|
|
21 |
st.image(image_file, caption=None, width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto")
|
22 |
|
23 |
|
24 |
+
model = tf.keras.models.load_model("cnnBoneFracRec.h5")
|
25 |
+
target_names = ['Non-Fractured', 'Fractured']
|
26 |
+
temp_img = image.load_img(image_file, target_size=(100, 100))
|
27 |
+
x = image.img_to_array(temp_img)
|
28 |
+
x = np.expand_dims(x, axis=0)
|
29 |
+
images = np.vstack([x])
|
30 |
+
prediction = np.argmax(model.predict(images), axis=1)
|
31 |
+
|
32 |
+
prediction_str = target_names[prediction.item()]
|
33 |
+
|
34 |
+
if prediction_str:
|
35 |
+
st.markdown(f"##### Prediction : {prediction_str}")
|