This repository contains code for detecting tomato leaf diseases using TensorFlow Object Detection API. The project includes scripts to set up the environment, train a custom object detection model using TensorFlow 2.x, convert the trained model to TensorFlow Lite format, and perform inference using the TFLite model.
-
Clone the TensorFlow models repository:
!pip uninstall Cython -y !git clone --depth 1 https://github.com/tensorflow/models
-
Set up dependencies and environment:
!pip install pyyaml==5.3 !pip install /content/models/research/ !pip install tensorflow==2.8.0 !pip install tensorflow_io==0.23.1 # Additional setup steps as per your environment requirements
-
Upload your image dataset and prepare training data:
from google.colab import drive drive.mount('/content/gdrive') !cp /content/gdrive/MyDrive/ColabNotebooks/data.zip /content !cp /content/gdrive/MyDrive/ColabNotebooks/images.zip /content !unzip -q data.zip -d /content !unzip -q images.zip -d /content
-
Customize the training configuration:
# Modify model configurations, batch size, and other parameters
-
Train the custom TensorFlow Lite detection model:
# Run training and save the model in TensorFlow Lite format
-
Test the TensorFlow Lite model:
# Perform inference with the TFLite model on test images
-
Calculate mAP (mean Average Precision):
# Run mAP calculation on detection results