Skip to content

Chuxwa/Global-Wheat-Detection-using-Yolov5

Repository files navigation

Global-Wheat-Detection

An efficient PyTorch library for Global Wheat Detection using YOLOv5. The project is based on this Kaggle competition Global Wheat Detection (May-Aug 2020).

Here's a description of the prediction task:

In this competition, you’ll detect wheat heads from outdoor images of wheat plants, including wheat datasets from around the globe. Using worldwide data, you will focus on a generalized solution to estimate the number and size of wheat heads. To better gauge the performance for unseen genotypes, environments, and observational conditions, the training dataset covers multiple regions. You will use more than 3,000 images from Europe (France, UK, Switzerland) and North America (Canada). The test data includes about 1,000 images from Australia, Japan, and China.

Installation

  1. Create a virtual environment via conda.

    conda create -n wheat_detection python=3.7
    conda activate wheat_detection
  2. Install torch and torchvision.

    conda install pytorch cudatoolkit=10.1 torchvision -c pytorch
  3. Install requirements.

    pip install -r requirements.txt

Dataset

An overview is available here: https://www.kaggle.com/c/global-wheat-detection/data.

Wheat heads were from various sources:
head
A few labeled images are as shown: (Blue bounding boxes):
head head

I used the following command to obtain the data:

kaggle competitions download -c global-wheat-detection

refer to pre_precessing.ipynb to preprocess the dataset:

  • Handled the noisy labels (too big/small boxes etc.)
  • Stratified 5 fold split based on source

Get Started

The pretrained models are available:

Please refer to YOLOv5.

Results

Following are the results we got from output files while our model was training.

Here is the PR curve of our model:

we deploy our model with flask as web app.

You can try to deploy our model with this repository

Acknowledgement

We thank for the inspiration from YOLOv5 and SENet

If you like our work and use the models for your research, please star our work.

About

An efficient PyTorch library for Global Wheat Detection using YOLOv5. The project is based on this Kaggle competition Global Wheat Detection (2021).

Resources

License

Stars

Watchers

Forks