This repository contains all the Pytorch models and the related code used in the development of this project
Our prime motivation for making this App was to provide an application that can be used by farmers and agricultural workers all around the globe. We wanted to make sure that our application provides a ton of really helpful features and also delivers it with a certain level of finesse.
This repository contains the following folders :
- HelperFunctions: This folder contains the helper functions that were used to develop the jupyter notebooks.We advise new users to not mess with these files and focus on running the model notebooks.
- CornDisease : This folder contains necessary notebooks for training and testing the model on corn diseases
- CottonDisease : This folder contains necessary notebooks for training and testing the model on cotton diseases
- Crop-Recommender : This folder contains necessary notebooks for training and testing the crop recommendation model
- FertilizerRecommender : This folder contains necessary notebooks for training and testing the model on fertilizer recommendation model
- FruitsClassifier : This folder contains necessary notebooks for training and testing the fruit classifier model
- LeavesDisease : This folder contains necessary notebooks for training and testing the model on several fruits and vegetable diseases
- RiceDisease : This folder contains necessary notebooks for training and testing the model on rice diseases
- Soil
- WheatDisease : This folder contains necessary notebooks for training and testing the model on wheat diseases
- YYMDisease : This folder contains necessary notebooks for training and testing the model on okra leaves (LadyFinger) suffering from yellow vein mosaic disease
The following libraries and APIs were used for the development of our project :
- Pytorch (torch and torchvision)
- Sklearn
- Pillow
- Numpy
- Pandas
- Matplotlib
- PlantNet API : We used this API to prefilter the image to make sure a valid image of fruit/leaf was being uploaded in the app
The list of related repositories that were used to develop Kronia can be found here
To properly set up this project on a local machine, please carefully go through the following steps
- Users can install Anaconda from here
- We highly recommend the readers create a new virtual environment for working on this project, as this will prevent users from messing up their local environments (that have already been setup)
- For beginners and new users, please refer to this link to know more about virtual environments and how to set up a new virtual environment
- To set up a new environment :
- Beginner Friendly
- If you haven't installed Anaconda please install Anaconda and then Open the Anaconda Navigator.
- Click on the environment tab (visible on the left side of the window)
- Click on the create button to create an environment
- Advanced
- Run
conda create name_of_env
- Run
activate name_of_env
(Windows) orsource activate name_of_env
(Linux/macOS) to switch into the created environment.(An anaconda cheatsheet can be found here)
- Run
- Beginner Friendly
- Now we need to install all the libraries that have been listed in the tech stack section.
- Move into the desired location on your local setup and make sure that you are using the correct virtual environment.
- In the appropriate terminal, run
git clone https://github.com/KroniaPytorch/KroniaModels.git
to get the codebase
- Once the dependencies have been installed and the code-base cloned, the user can now train the model or test it on custom images
- Please keep in mind the folder hierarchy and move into the appropriate folder
- To train the model again (with your tweaked settings), run the notebook with the name that matches the folder
- To test the model, make sure you have downloaded the weights(read next step) or have generated a new weight file by training the model and then run Inference notebook in the folder
- Weights for the particular model can be downloaded from here
- Please note: Before Running the model, make sure you are running the notebook from the appropriate environment
- If for some reason the user finds some trouble in installing the code, we also provide "Quick-Use" files that can be used by the user to test the models on custom images
- The user can find the files here
- The user will find an Inference ("Quick Use") file that can be executed in Google Colab along with the appropriate weight files(available in the link mentioned above)