Spaces:
Sleeping
Sleeping
nishantguvvada
commited on
Commit
·
f6ad381
1
Parent(s):
ac8451b
updated result
Browse files
app.py
CHANGED
@@ -25,11 +25,7 @@ def model_prediction(path):
|
|
25 |
with st.spinner('Model is being loaded..'):
|
26 |
model=load_model()
|
27 |
yhat = model.predict(np.expand_dims(resize/255, 0))
|
28 |
-
|
29 |
-
result = "Prediction is loose"
|
30 |
-
else:
|
31 |
-
result = "Prediction is control"
|
32 |
-
return result
|
33 |
|
34 |
def on_click():
|
35 |
if file is None:
|
@@ -39,10 +35,9 @@ def on_click():
|
|
39 |
st.image(image, use_column_width=True)
|
40 |
image = image.convert('RGB')
|
41 |
predictions = model_prediction(np.array(image))
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
.
|
46 |
-
)
|
47 |
|
48 |
st.button('Predict', on_click=on_click)
|
|
|
25 |
with st.spinner('Model is being loaded..'):
|
26 |
model=load_model()
|
27 |
yhat = model.predict(np.expand_dims(resize/255, 0))
|
28 |
+
return yhat
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def on_click():
|
31 |
if file is None:
|
|
|
35 |
st.image(image, use_column_width=True)
|
36 |
image = image.convert('RGB')
|
37 |
predictions = model_prediction(np.array(image))
|
38 |
+
if (predictions>0.5):
|
39 |
+
st.write("""# Prediction : Implant is loose""")
|
40 |
+
else:
|
41 |
+
st.write("""# Prediction : Implant is in control""")
|
|
|
42 |
|
43 |
st.button('Predict', on_click=on_click)
|