This repository contains code for training and testing a custom Mask R-CNN model to detect various leaf diseases. The project uses the Mask R-CNN implementation from Matterport.
- Forking the Repository
- Cloning the Repository
- Installing Dependencies
- Setting Up the Project
- Running the Script
- Acknowledgments
- Go to the GitHub repository you want to fork.
- Click on the
Fork
button on the top right corner of the repository page. - Select your GitHub account to fork the repository.
- After forking the repository, clone it to your local machine using the following command:
git clone https://github.com/your-username/your-repo-name.git
1. pip install -r requirements.txt
2. conda create -n maskrcnn python=3.6.8
3. conda activate maskrcnn
4. pip install tensorflow==1.15.0
1. git clone https://github.com/matterport/Mask_RCNN.git
cd Mask_RCNN
python setup.py install
cd ..
-
Copy the mrcnn folder from the Mask R-CNN repository into your project directory.
-
Set the root directory in custom.py to your project directory:
(python code) ROOT_DIR = "path/to/your/project"
Ensure you have the COCO weights file in your project directory. If not, download it from COCO weights.
- To train the model, run the custom.py script:
python custom.py
After training, the weights will be saved in the logs directory.
- To test the model, use the test_model.ipynb Jupyter notebook:
jupyter notebook test_model.ipynb
- Load the trained weights and run the inference on your test images.
This README file includes all the instructions and necessary code for setting up and running the Mask R-CNN model for leaf disease detection.