Spaces:
Sleeping
Sleeping
nishantguvvada
commited on
Commit
·
2b4cccf
1
Parent(s):
0345d0b
update argument
Browse files
app.py
CHANGED
@@ -20,8 +20,8 @@ st.write("""
|
|
20 |
file = st.file_uploader("Upload an X-ray image", type= ['png', 'jpg'])
|
21 |
|
22 |
|
23 |
-
def model_prediction(
|
24 |
-
resize = tf.image.resize(
|
25 |
yhat = model.predict(np.expand_dims(resize/255, 0))
|
26 |
if(yhat>0.5):
|
27 |
result = "Prediction is loose"
|
@@ -34,7 +34,7 @@ if file is None:
|
|
34 |
else:
|
35 |
image = Image.open(file)
|
36 |
st.image(image, use_column_width=True)
|
37 |
-
predictions = model_prediction(
|
38 |
st.write(prediction)
|
39 |
print(
|
40 |
"This image most likely belongs to {}."
|
|
|
20 |
file = st.file_uploader("Upload an X-ray image", type= ['png', 'jpg'])
|
21 |
|
22 |
|
23 |
+
def model_prediction(image, model):
|
24 |
+
resize = tf.image.resize(image, (256,256))
|
25 |
yhat = model.predict(np.expand_dims(resize/255, 0))
|
26 |
if(yhat>0.5):
|
27 |
result = "Prediction is loose"
|
|
|
34 |
else:
|
35 |
image = Image.open(file)
|
36 |
st.image(image, use_column_width=True)
|
37 |
+
predictions = model_prediction(file, model)
|
38 |
st.write(prediction)
|
39 |
print(
|
40 |
"This image most likely belongs to {}."
|