shaheer-data commited on
Commit
ac847e4
·
verified ·
1 Parent(s): 03e9f6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
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.write("Predicted Severity Class: Healthy")
51
- st.write("**Advice:** The leaf appears healthy. Continue monitoring as needed.")
52
  elif predicted_class == 1:
53
- st.write("Predicted Severity Class: Mild Rust (MR)")
54
- st.write("**Advice:** Apply fungicides to control mild rust development.")
55
  elif predicted_class == 2:
56
- st.write("Predicted Severity Class: Moderate Rust (MRMS)")
57
- st.write("**Advice:** Monitor regularly and treat with appropriate fungicides.")
58
  elif predicted_class == 3:
59
- st.write("Predicted Severity Class: Severe Rust (MS)")
60
- st.write("**Advice:** Apply fungicides promptly and continue monitoring.")
61
  elif predicted_class == 4:
62
- st.write("Predicted Severity Class: Very Severe Rust (R)")
63
- st.write("**Advice:** Implement intensive control measures and frequent monitoring.")
64
  elif predicted_class == 5:
65
- st.write("Predicted Severity Class: Extremely Severe Rust (S)")
66
- st.write("**Advice:** Apply aggressive control strategies and seek expert advice.")
67
 
68
  confidence = np.max(prediction) * 100
69
  st.write(f"**Confidence Level:** {confidence:.2f}%")
70
 
71
  # Footer
72
- st.sidebar.info("MPHIL Final Year Project By Mr. Asim Khattak")
 
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")