Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ warnings.filterwarnings("ignore")
|
|
13 |
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
|
14 |
|
15 |
st.set_page_config(
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
)
|
20 |
|
21 |
hide_streamlit_style = """
|
22 |
<style>
|
@@ -34,11 +34,19 @@ def prediction_cls(prediction):
|
|
34 |
|
35 |
|
36 |
with st.sidebar:
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
st.set_option("deprecation.showfileUploaderEncoding", False)
|
43 |
|
44 |
|
@@ -72,9 +80,6 @@ else:
|
|
72 |
image = keras.preprocessing.image.load_img(file, target_size=(224, 224), color_mode='rgb')
|
73 |
st.image(image, caption="Uploaded Image.", use_column_width=True)
|
74 |
predictions = import_and_predict(image, model)
|
75 |
-
np.random.seed(42)
|
76 |
-
x = random.randint(98, 99) + random.randint(0, 99) * 0.01
|
77 |
-
st.error("Accuracy : " + str(x) + " %")
|
78 |
print(predictions)
|
79 |
class_names = [
|
80 |
"Normal",
|
|
|
13 |
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
|
14 |
|
15 |
st.set_page_config(
|
16 |
+
page_title="ChestAI - Pneumonia Detection",
|
17 |
+
page_icon="🫁",
|
18 |
+
initial_sidebar_state="expanded"
|
19 |
+
)
|
20 |
|
21 |
hide_streamlit_style = """
|
22 |
<style>
|
|
|
34 |
|
35 |
|
36 |
with st.sidebar:
|
37 |
+
st.title("👋 Welcome to ChestAI")
|
38 |
+
st.markdown("""
|
39 |
+
### About
|
40 |
+
ChestAI uses advanced deep learning to detect pneumonia in chest X-rays.
|
41 |
+
|
42 |
+
### How to use
|
43 |
+
1. Upload a chest X-ray image (JPG/PNG)
|
44 |
+
2. Wait for the analysis
|
45 |
+
3. View the results and confidence score
|
46 |
+
|
47 |
+
### Note
|
48 |
+
This tool is for educational purposes only. Always consult healthcare professionals for medical advice.
|
49 |
+
""")
|
50 |
st.set_option("deprecation.showfileUploaderEncoding", False)
|
51 |
|
52 |
|
|
|
80 |
image = keras.preprocessing.image.load_img(file, target_size=(224, 224), color_mode='rgb')
|
81 |
st.image(image, caption="Uploaded Image.", use_column_width=True)
|
82 |
predictions = import_and_predict(image, model)
|
|
|
|
|
|
|
83 |
print(predictions)
|
84 |
class_names = [
|
85 |
"Normal",
|