luisotorres commited on
Commit
4526676
1 Parent(s): 48dedaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -22,9 +22,9 @@ def predict(input_image):
22
 
23
  class_idx = np.argmax(predictions)
24
  class_label = labels[class_idx]
25
- confidence = predictions[0][class_idx]
26
 
27
- return f"Predicted Class: {class_label} <br><br> Confidence Score: {confidence}"
28
 
29
  except Exception as e:
30
  return f"An error occurred: {e}"
@@ -36,9 +36,9 @@ iface = gr.Interface(
36
  inputs=gr.inputs.Image(shape=(256, 256)),
37
  outputs="text",
38
  title="🌿 Plant Disease Detection",
39
- description='<br> This specialized Image Classification model identifies the health status of plants, pinpointing conditions like Powdery Mildew or Rust. <br>\
40
- The model is engineered on a Convolutional Neural Network and has been rigorously trained, evaluated, and validated. Kaggle Notebook: <a href="https://www.kaggle.com/code/lusfernandotorres/convolutional-neural-network-from-scratch">🧠 Convolutional Neural Network From Scratch</a>. <br> \
41
- <br> Upload a photo of a plant for classification!',
42
  examples=examples
43
  )
44
 
 
22
 
23
  class_idx = np.argmax(predictions)
24
  class_label = labels[class_idx]
25
+ confidence = np.round(predictions[0][class_idx], 3)
26
 
27
+ return f"Predicted Class: {class_label}. Confidence Score: {confidence}"
28
 
29
  except Exception as e:
30
  return f"An error occurred: {e}"
 
36
  inputs=gr.inputs.Image(shape=(256, 256)),
37
  outputs="text",
38
  title="🌿 Plant Disease Detection",
39
+ description='<br> This is a specialized Image Classification model engineered to identify the health status of plants, specifically detecting conditions of Powdery Mildew or Rust. <br> \
40
+ This model is based on a Convolutional Neural Network that I have trained, evaluated, and validated on my Kaggle Notebook: <a href="https://www.kaggle.com/code/lusfernandotorres/convolutional-neural-network-from-scratch">🧠 Convolutional Neural Network From Scratch</a>. <br> \
41
+ <br> Upload a photo of a plant to see how the model classifies its status!',
42
  examples=examples
43
  )
44