WoodratTradeCo / crop-rows-detection

It is an real-time crop rows detection method using YOLOv5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Real-time detection of crop rows in maize fields based on autonomous extraction of ROI

It is a crop rows detection method using YOLOv5 object detection model.

  1. ⚡Super fast: It takes only 25 ms to process a single image (640*360 pixels) and the frame rate of video stream exceeds 40FPS.
  2. 👍Multiple periods: The model is tranied on the dataset including of various crop rows periods.
  3. 🤗High accruacy: The average error angle of the detection lines is 1.88◦, which can meet the accuracy requirements of field navigation.

Architecture

1702287039880

Labeled images

1702287116895

Image processing

1702292437924

Results

f649d746cbc01e56a48fb62a730a6960.mp4
3722b03019c9b9c36c3650969fe6057f.mp4

Usage (How to test our model)

Thanks to the contribution, the code is based on https://github.com/ultralytics/yolov5.

# 1. Download the trained weights and training log files.
The trained model is uploaded on https://drive.google.com/file/d/1uca8t8SYReriOtuzo5_RZsCJqb2ggmte/view?usp=sharing. Model and training log can be obtained after unzipping.
# 2. Install the requirment.txt
# 3. Run detect.py. 
We have prepared 5 videos for testing, the root is test_video/*.mp4(avi). Images format is not accepected yet.
# 4. Change the test vedio.
If you want to change the test video, you have to revise the line 300 in detect.py

NOTE:

  1. We shared the part of our datasets. In this project, we trained 1500 images. It is sorry that we cannot share all the dataset. But you can still check some typical images in folder "mydata/images/train". The traning log is shown in "runs/train/exp1".
  2. It is noted that we just provide a solution for crop rows detection, if you want to run the code in your own data. We strongly suggest you to make some datasets to train your own data to ensure the performance of the model.

If you find this code useful to your research, please cite our paper as the following bibtex:

@article{yang2023real,
  title={Real-time detection of crop rows in maize fields based on autonomous extraction of ROI},
  author={Yang, Yang and Zhou, Yang and Yue, Xuan and Zhang, Gang and Wen, Xing and Ma, Biao and Xu, Liangyuan and Chen, Liqing},
  journal={Expert Systems with Applications},
  volume={213},
  pages={118826},
  year={2023},
  publisher={Elsevier}
}

About

It is an real-time crop rows detection method using YOLOv5

License:GNU General Public License v3.0


Languages

Language:Python 98.2%Language:Dockerfile 1.0%Language:Shell 0.9%