Skip to content

URS1023/cotton

Repository files navigation

棉花生长阶段检测系统 (Cotton Growth Stage Detection System)

Copyright (c) 2024 UR. All rights reserved.

基于YOLOv5的棉花生长阶段检测系统,可以实时识别和监测棉花的不同生长阶段。本系统旨在帮助农业工作者和研究人员更好地监测和管理棉花的生长过程,提高棉花种植的科学性和效率。

English Version Below

项目背景

棉花的生长过程监测对于农业生产具有重要意义。通过及时识别棉花的不同生长阶段,可以:

  • 优化田间管理措施
  • 科学调控生长进程
  • 提高产量和品质
  • 降低人工监测成本
  • 实现精准农业管理

功能特点

  • 📷 多种检测方式

    • 图片检测:上传图片进行棉花生长阶段检测
    • 视频检测:上传视频文件进行连续检测
    • 实时检测:通过网络摄像头进行实时监测
  • 🎯 检测类别

    1. Cotton Blossom(棉花花朵)

      • 棉花开花阶段的花朵识别
      • 特征:花瓣呈黄白色,花朵完全展开
      • 关键时期:开花期管理的重要指标
    2. Cotton Bud(棉花蓓蕾)

      • 棉花未开放的花蕾阶段
      • 特征:呈椭圆形,外包苞叶
      • 关键时期:关系到后期产量形成
    3. Early Boll(早期棉铃)

      • 棉花授粉后形成的初期棉铃
      • 特征:青绿色,大小约2-3厘米
      • 关键时期:需要加强水肥管理
    4. Matured Cotton Boll(成熟棉铃)

      • 完全发育但未开裂的棉铃
      • 特征:棉铃饱满,呈浅褐色
      • 关键时期:即将进入采收阶段
    5. Split Cotton Boll(开裂棉铃)

      • 成熟开裂后露出棉絮的棉铃
      • 特征:棉铃开裂,露出白色棉絮
      • 关键时期:适合采收的最佳阶段

系统优势

  • 🚀 实时检测:快速响应,实时显示检测结果
  • 🎨 可视化展示:直观显示检测框和类别标签
  • 💻 友好界面:简单易用的中文操作界面
  • 🔄 多场景适用:支持多种输入方式,适应不同使用场景
  • 📊 高精度识别:基于先进的YOLOv5模型
  • 🌐 跨平台支持:支持Windows/Linux/Mac系统
  • 📱 响应式设计:适配不同设备屏幕

环境要求

  • Python 3.8+
  • CUDA 11.0+ (GPU加速,可选)
  • 内存:8GB+
  • 存储空间:10GB+ alt text

使用说明

  1. 图片检测
    • 点击"上传图片"按钮
    • 选择需要检测的图片
    • 点击"开始检测图片中的物体"按钮
    • 系统将自动分析并显示检测结果 alt text
  2. 视频检测
    • 点击"上传视频"按钮
    • 选择需要检测的视频文件
    • 点击"开始检测视频中的物体"按钮
    • 系统将逐帧分析并显示检测结果 alt text
  3. 实时检测
    • 确保设备已连接摄像头
    • 点击"开始检测摄像头"按钮
    • 系统将自动开始实时检测
    • 可随时暂停或停止检测 alt text

项目结构

project/
├── app.py              # Flask应用主程序
├── index.html          # 前端页面
├── styles.css          # 样式文件
├── models/             # 模型文件目录
├── utils/             # 工具函数
├── data/              # 数据相关文件
├── exp6/              # 训练权重
└── temp/              # 临时文件目录

技术架构

  • 前端

    • HTML5:页面结构
    • CSS3:页面样式
    • JavaScript:交互功能
  • 后端

    • Flask:Web框架
    • Python:主要编程语言
  • AI模型

    • YOLOv5:目标检测框架
    • PyTorch:深度学习框架
    • OpenCV:图像处理库

English Version

Cotton Growth Stage Detection System

Copyright (c) 2024 UR. All rights reserved.

A YOLOv5-based cotton growth stage detection system that can identify and monitor different growth stages of cotton in real-time. This system aims to help agricultural workers and researchers better monitor and manage cotton growth processes, improving the scientific approach and efficiency of cotton cultivation.

Project Background

Monitoring cotton growth processes is crucial for agricultural production. Through timely identification of different cotton growth stages, we can:

  • Optimize field management measures
  • Scientifically control growth processes
  • Improve yield and quality
  • Reduce manual monitoring costs
  • Achieve precision agriculture management

Features

  • 📷 Multiple Detection Methods

    • Image Detection: Upload images for cotton growth stage detection
    • Video Detection: Upload video files for continuous detection
    • Real-time Detection: Real-time monitoring through webcam
  • 🎯 Detection Categories

    1. Cotton Blossom

      • Recognition of cotton flowers in blooming stage
      • Characteristics: Yellow-white petals, fully opened flowers
      • Critical Period: Important indicator for flowering period management
    2. Cotton Bud

      • Pre-flowering bud stage
      • Characteristics: Oval shape, wrapped in bracts
      • Critical Period: Crucial for later yield formation
    3. Early Boll

      • Initial cotton boll formed after pollination
      • Characteristics: Green color, approximately 2-3cm in size
      • Critical Period: Requires enhanced water and fertilizer management
    4. Matured Cotton Boll

      • Fully developed but unopened cotton boll
      • Characteristics: Full boll, light brown color
      • Critical Period: Approaching harvest stage
    5. Split Cotton Boll

      • Mature boll with exposed cotton fiber
      • Characteristics: Split boll with white cotton fiber exposed
      • Critical Period: Optimal stage for harvesting

System Advantages

  • 🚀 Real-time Detection: Quick response with instant result display
  • 🎨 Visual Presentation: Intuitive display of detection boxes and labels
  • 💻 User-friendly Interface: Simple and easy-to-use interface
  • 🔄 Multi-scenario Application: Supports various input methods
  • 📊 High Accuracy: Based on advanced YOLOv5 model
  • 🌐 Cross-platform Support: Compatible with Windows/Linux/Mac
  • 📱 Responsive Design: Adapts to different device screens

System Requirements

  • Python 3.8+
  • CUDA 11.0+ (GPU acceleration, optional)
  • Memory: 8GB+
  • Storage Space: 10GB+

Installation

# Clone the project
git clone [project URL]
cd [project directory]

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt

Usage Instructions

  1. Image Detection

    • Click "Upload Image" button
    • Select the image for detection
    • Click "Start Object Detection" button
    • System will automatically analyze and display results
  2. Video Detection

    • Click "Upload Video" button
    • Select the video file for detection
    • Click "Start Video Detection" button
    • System will analyze frame by frame and display results
  3. Real-time Detection

    • Ensure webcam is connected
    • Click "Start Webcam Detection" button
    • System will begin real-time detection
    • Can pause or stop detection at any time

Project Structure

project/
├── app.py              # Flask application main program
├── index.html          # Frontend page
├── styles.css          # Style file
├── models/             # Model files directory
├── utils/             # Utility functions
├── data/              # Data related files
├── exp6/              # Training weights
└── temp/              # Temporary files directory

Technical Architecture

  • Frontend

    • HTML5: Page structure
    • CSS3: Page styling
    • JavaScript: Interactive functionality
  • Backend

    • Flask: Web framework
    • Python: Main programming language
  • AI Model

    • YOLOv5: Object detection framework
    • PyTorch: Deep learning framework
    • OpenCV: Image processing library

Performance Metrics

  • Detection Speed: <200ms/frame
  • Average Accuracy: >90%
  • Supported Image Formats: JPG, PNG, BMP, etc.
  • Supported Video Formats: MP4, AVI, MOV, etc.

Usage Notes

  1. Image Requirements

    • Resolution: Recommended minimum 640x640
    • Lighting: Avoid over/under exposure
    • Angle: Maintain frontal view when possible
  2. Video Requirements

    • Frame Rate: Recommended 25fps+
    • Resolution: Recommended 720p+
    • Duration: Recommended under 5 minutes
  3. Real-time Detection

    • Camera Resolution: Recommended 720p+
    • Network Bandwidth: Recommended 10Mbps+
    • Environmental Lighting: Maintain adequate and uniform lighting

FAQ

  1. Q: System won't start? A: Check Python environment and dependency installation

  2. Q: Slow detection speed? A: Consider using GPU acceleration or reducing input resolution

  3. Q: Inaccurate detection? A: Check image quality, ensure adequate lighting and correct angle

Version History

v1.0.0 (2024-01-05)

  • Initial release
  • Support for image, video, and real-time detection
  • Integration of YOLOv5 model

Contact

For questions or suggestions, please contact:

  • Email: [Your Email]
  • Project Issues: [Project Issues URL]

License

This project is licensed under the MIT License


Developed by UR © 2024

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages