Skip to content

gyhdc/wheat-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository has made public the key configurations for model training and detection related to the paper "Counting wheat heads using a simulation model" [--], as well as the unified code for evaluating model detection and counting performance.

The main.py in the Assess folder is the main code for evaluation and test.

The Models folder contains the configuration files for the model during training and test.

The Figs folder contains the code for drawing the main figures and charts in the paper.

During training, test, inference, images will always first be converted to grayscale images.

Dataset

Dataset could be downloaded from figshare.
We use grayscale images for training and testing(images_grayscale folders in the dataset), grayscale images can also be converted from original rgb images through util/to_gray.py.

Trained models

The pretrained YOLOv7 model trained with our simulation wheat images can be downloaded from Dropbox-yolo-wheat.

Training

  1. Clone this repository to your local machine.
  2. Download the original YOLOv7 pretrained model from WongKinYiu's YOLOv7 and place it in the weights folder.
  3. In Models/YOLOV7/data/MakeMyData.yaml, specify the paths for your training set (processed in grayscale) and validation set (also processed in grayscale).
  4. Optionally, set custom parameters (defaults are available).
  5. Run train.py in Models/YOLOV7 to start training the model. Expected results should appear within 25-75 epochs.

Test

  1. In detect.py, modify custom parameters as needed (defaults are acceptable).
  2. Set the path for the test dataset.
  3. Run detect.py. Results will be available in the runs/detect folder.
  4. In the main.py inside Assess, specify the path for the labels of the test dataset and the labels of detection results.
  5. Run main.py. Results will be printed in the console.

Detection (Inference)

  1. In detect.py, modify custom parameters as needed (defaults are acceptable).
  2. Set the path for the test dataset.
  3. Run the script for detection. Results will be available in the runs/detect folder.

About

Counting wheat heads using a simulation model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages