Skip to content

tanmaypandey7/wheat-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheat Detection

Detecting wheat heads using YOLOv5

Web App Demo

Open In Colab

https://imgur.com/a/Ap2kaeX

Brief overview of the competition images

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

Pre-trained models

Models can be downloaded from here. (Use last_yolov5x_4M50fold0.pt for best results)

Modifications

The YOLOv5 notebook internally does some augmentations while preparing a Dataset. Originally, this Dataset consists of only Mosaic images.

Mosaic - https://arxiv.org/pdf/2004.12432.pdf
4 images are cropped and stitched together
head

Here, I modified the repo to add Mixup.

Mixup - https://arxiv.org/pdf/1710.09412.pdf
2 images are mixed together head

I modified the code(especifically utils.datasets) so it had a 50-50 chance of creating a mixup or a mosaic image. This was very helpful for us as it boosted our public score from 0.77->0.7769.

These developments were made before we found out that YOLOv5 was non-compliant and had to switch to EfficientDet for our final 2 submissions. Kaggle later updated the leaderboard with the final 2 submissions and we ended up at 113th Private(Top 6%).

Training

We trained the model for 50 epochs on Colab Pro.

Inference and Deployment

Our best model is currently being used for inference in this web-app. I uses HTML and CSS as front-end and Flask as the backend. This web-app is served on Google Colab but can be easily deployed on AWS or GCP as well.