Agri-Vision is an AI-powered system that analyzes cotton crop images to determine growth stages and health conditions.
It helps farmers and researchers make informed decisions about crop management and harvest timing.
Agri-Vision uses deep learning and computer vision techniques to:
- Detect cotton growth phases
- Identify crop health issues and diseases
- Provide confidence scores and actionable recommendations
- Offer both a web interface and a REST API
- πΏ Growth Phase Detection (4 stages)
- π Health Assessment (disease & damage detection)
- π€ AI-Powered Analysis using deep learning
- π Web Interface (Flask-based)
- π REST API Support for programmatic access
- π― Smart Recommendations for farmers
- β‘ Fast Processing (< 2 seconds per image)
- Python
- Flask
- TensorFlow
- OpenCV
- HTML/CSS
- JavaScript
Agri-Vision/
β
βββ results/ # Stores output results and visualizations
β βββ training_history.png
β
βββ static/ # Static assets
β βββ css/
β βββ uploads/
β βββ favicon.png
β
βββ templates/ # Flask HTML templates
β βββ index.html
β βββ results.html
β βββ upload.html
β
βββ .env # Environment variables (create manually)
βββ .gitignore
βββ app.py # Main Flask application
βββ LICENSE
βββ README.md
βββ requirements.txt
βββ train.py # Model training script
Follow the steps below to run the project locally.
git clone <repository-url>
cd <project-folder>Create a .env file in the root directory of the project and add your secret key.
SECRET_KEY=your_secret_key_hereReplace your_secret_key_here with your actual secret key.
Install all the required Python packages using:
pip install -r requirements.txtStart the application using:
python app.pyThe project should now be running successfully on your local machine.
- π± Vegetative / Budding β Early growth stage
- πΈ Flowering β Flower development stage
- π Bursting (Ripped) β Cotton bolls opening
- β Harvest Ready β Optimal harvest time
- β Healthy β No issues detected
- π Pink Bollworm Damage β Pest infestation detected
- π¨ Discoloration β Nutrient or water deficiency
β οΈ Other Damage β Miscellaneous crop issues
curl -X POST -F "file=@cotton_image.jpg" http://localhost:5000/api/analyze{
"status": "success",
"analysis": {
"stage": "Bursting (Ripped)",
"stage_confidence": 0.87,
"health_status": "Pink Bollworm Damage",
"health_confidence": 0.76,
"health_score": 68.5,
"is_ripped": true,
"has_damage": true
},
"recommendations": ["..."]
}- Go to
/analyze - Upload a cotton crop image
- View detailed analysis results
- Download the JSON report if needed
- β Accuracy: ~85β90% on test data
- β‘ Processing Time: < 2 seconds per image
- πΌοΈ Supported Formats: JPG, PNG, JPEG
- π¦ Maximum File Size: 10MB
- π± Mobile application support
- π₯ Real-time video analysis
- πΎ Multi-crop support
- βοΈ Weather data integration
- π Yield prediction system
- π§ Improved AI models
Contributions are welcome to improve Agri-Vision and make it more useful for farmers, researchers, and developers.
Feel free to:
- Fork the repository
- Create a feature branch
- Submit a pull request
- Do not start working on an issue until it is assigned to you.
- Comment on the issue you want to work on.
- Wait for maintainers to assign the issue before creating a PR.
- Mention the related issue in your PR description using:
Closes #issue_numberFixes #issue_number
- Keep PRs focused on a single issue/topic.
- Add screenshots or demo videos for UI-related changes.
- Sync your branch with the latest repository changes before submitting a PR.
- Follow the project structure and coding style.
- Avoid spam or duplicate PRs/issues.
- Be respectful during code reviews and discussions.
- Beginners are welcome β feel free to ask questions if stuck β¨
This project is licensed under the MIT License.
See the LICENSE file for more details.
Special thanks to:
- TensorFlow
- Flask
- OpenCV
- Open-source contributors
- Agricultural research datasets