Skip to content

Commit

Permalink
ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidd-77 committed Apr 6, 2024
1 parent a9c2f90 commit c048842
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ def __init__(self):

obj = ClientApp()

st.title('Kindney Disease Classification Using Deep Learning')
st.title('Kindney Disease :health_worker: Classification Using Deep Learning')
st.divider()
st.subheader("Upload your image of kidney ct-scan to cheack for any disease")

uploaded_file = st.file_uploader("Choose a file")
uploaded_file = st.file_uploader("Choose a file", type=['jpg','png','jpeg'])
if uploaded_file is not None:
with open(obj.filename, "wb") as f:
f.write(uploaded_file.getbuffer())
f.close()
prediction, result_raw = obj.classifier.predict()
if(prediction=='Failed'):
st.write("Something went wrong")
elif(prediction=='Normal'):
st.write("You have healthy kidney")
st.write("You don't have any disease")
else:
st.write("You have ",prediction," kidney")
st.write("You have unhealthy kideny")
st.write("You have ",prediction," in your kidney")
df = pd.DataFrame(data=result_raw, columns=['Cyst', 'Normal', 'Stone', 'Tumor'], index=None)
st.write("Probablity for each case : ")
st.dataframe(df)
Expand Down
Binary file modified inputImage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/CNN_Classifier/pipeline/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ def predict(self, ):
test_image = np.expand_dims(test_image, axis=0)

result_raw = model.predict(test_image)
result = np.argmax(result_raw, axis=0)
result = np.argmax(result_raw[0], axis=0)
print(result_raw)
print(result)

if result[0] == 0:
if result == 0:
prediction = "Cyst"
return (prediction, result_raw)
elif result[1] == 1:
elif result == 1:
prediction = "Normal"
return (prediction, result_raw)
elif result[2] == 2:
elif result == 2:
prediction = "Stone"
return (prediction, result_raw)
elif result[3] == 3:
elif result == 3:
prediction = "Tumor"
return (prediction, result_raw)

Expand Down

0 comments on commit c048842

Please sign in to comment.