Skip to content

Repository files navigation

Leaf Disease Detection

This repository contains a simple example for detecting diseased apple leaves (We can use the same structure for any anomaly detection). The code was originally developed as a Google Colab notebook and demonstrates image preprocessing, a small convolutional neural network, and basic evaluation.

Contents

  • leaf_disease_detection.py - Main script (Colab-oriented) with preprocessing, model definition, training, and evaluation.

Requirements

  • Python 3.8+
  • TensorFlow
  • OpenCV (cv2)
  • imutils
  • scikit-learn
  • matplotlib
  • numpy

You can install the main packages with:

pip install tensorflow opencv-python imutils scikit-learn matplotlib numpy

Notes about Colab

The script uses Google Colab-specific helpers (google.colab.drive and google.colab.patches.cv2_imshow). To run locally, remove or adapt the Colab mount lines and update dataset paths to point to a local folder structure.

Running locally (quick)

  1. Update the dataset paths inside leaf_disease_detection.py to point to your local dataset directories.
  2. Remove or comment out the drive.mount(...) line and Colab-specific cv2_imshow usages, replacing them with cv2.imshow or matplotlib display calls where appropriate.
  3. Run:
python leaf_disease_detection.py

Personal project/learning/studies!

About

This repository contains a simple example for detecting diseased apple leaves demonstrates image preprocessing, a small convolutional neural network, and basic evaluation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages