Spaces:
Sleeping
Sleeping
shaheer-data
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -46,27 +46,29 @@ if uploaded_file is not None:
|
|
46 |
predicted_class = np.argmax(prediction, axis=1)[0] # Get the class index
|
47 |
class_labels = ['0', 'MR', 'MRMS', 'MS', 'R', 'S'] # Update based on your classes
|
48 |
|
|
|
|
|
49 |
if predicted_class == 0:
|
50 |
-
st.
|
51 |
-
st.write("
|
52 |
elif predicted_class == 1:
|
53 |
-
st.
|
54 |
-
st.write("
|
55 |
elif predicted_class == 2:
|
56 |
-
st.
|
57 |
-
st.write("
|
58 |
elif predicted_class == 3:
|
59 |
-
st.
|
60 |
-
st.write("
|
61 |
elif predicted_class == 4:
|
62 |
-
st.
|
63 |
-
st.write("
|
64 |
elif predicted_class == 5:
|
65 |
-
st.
|
66 |
-
st.write("
|
67 |
|
68 |
confidence = np.max(prediction) * 100
|
69 |
st.write(f"**Confidence Level:** {confidence:.2f}%")
|
70 |
|
71 |
# Footer
|
72 |
-
st.
|
|
|
46 |
predicted_class = np.argmax(prediction, axis=1)[0] # Get the class index
|
47 |
class_labels = ['0', 'MR', 'MRMS', 'MS', 'R', 'S'] # Update based on your classes
|
48 |
|
49 |
+
st.header("Predicted Severity Class")
|
50 |
+
|
51 |
if predicted_class == 0:
|
52 |
+
st.markdown('<p style="color: green; font-size: 20px;">Healthy</p>', unsafe_allow_html=True)
|
53 |
+
st.write("The leaf appears healthy. There is no immediate action required. Continue monitoring as needed.")
|
54 |
elif predicted_class == 1:
|
55 |
+
st.markdown('<p style="color: orange; font-size: 20px;">Mild Rust (MR)</p>', unsafe_allow_html=True)
|
56 |
+
st.write("Mild rust detected. Applying fungicides will help control further spread.")
|
57 |
elif predicted_class == 2:
|
58 |
+
st.markdown('<p style="color: #FFA500; font-size: 20px;">Moderate Rust (MRMS)</p>', unsafe_allow_html=True)
|
59 |
+
st.write("Moderate rust detected. Monitor regularly and treat with fungicides.")
|
60 |
elif predicted_class == 3:
|
61 |
+
st.markdown('<p style="color: #FF4500; font-size: 20px;">Severe Rust (MS)</p>', unsafe_allow_html=True)
|
62 |
+
st.write("Severe rust detected. Prompt fungicide application and continued monitoring are recommended.")
|
63 |
elif predicted_class == 4:
|
64 |
+
st.markdown('<p style="color: red; font-size: 20px;">Very Severe Rust (R)</p>', unsafe_allow_html=True)
|
65 |
+
st.write("Very severe rust detected. Intensive control measures and frequent monitoring are required.")
|
66 |
elif predicted_class == 5:
|
67 |
+
st.markdown('<p style="color: darkred; font-size: 20px;">Extremely Severe Rust (S)</p>', unsafe_allow_html=True)
|
68 |
+
st.write("Extremely severe rust detected. Apply aggressive control strategies and seek expert advice.")
|
69 |
|
70 |
confidence = np.max(prediction) * 100
|
71 |
st.write(f"**Confidence Level:** {confidence:.2f}%")
|
72 |
|
73 |
# Footer
|
74 |
+
st.info("MPHIL Final Year Project By Mr. Asim Khattak")
|