Views
No views yet
The NWRD Dataset: An Open-Source Annotated Segmentation Dataset of Diseased Wheat Crop..jpg format and the annotated binary masks are available in .png format. Below is the directory structure of this dataset:NWRD
├── test
│ ├── images
│ └── masks
└── train
├── images
└── masks| Split | Percentage |
|---|---|
| Train + Valid | 90 |
| Test | 10 |
| Total | 100 |
| Split | Images |
|---|---|
| Train + Valid | 2, 7, 14, 30, 64, 83, 84, 90, 94, 95, 100, 118, 124, 125, 132, 133, 136, 137, 138, 146 |
| Test | 67, 123 |
config.json file.
Use python train.py -c config.json to run code..json format:1{
2 "name": "WRS", // training session name
3 "n_gpu": 1, // number of GPUs to use for training.
4
5 "arch": {
6 "type": "UNet", // name of model architecture to train
7 "args": {
8 "n_channels": 3,
9 "n_classes": 2
10 } // pass arguments to the model
11 },
12 "data_loader": {
13 "type": "PatchedDataLoader", // selecting data loader
14 "args":{
15 "data_dir": "data/", // dataset path
16 "patch_size": 128, // patch size
17 "batch_size": 64, // batch size
18 "patch_stride": 32, // patch overlapping stride
19 "target_dist": 0.01, // least percentage of rust pixels in a patch
20 "shuffle": true, // shuffle training data before
21 "validation_split": 0.1, // size of validation dataset. float(portion) or int(number of samples)
22 "num_workers": 2 // number of cpu processes to be used for data loading
23 }
24 },
25 "optimizer": {
26 "type": "RMSprop",
27 "args":{
28 "lr": 1e-6, // learning rate
29 "weight_decay": 0
30 }
31 },
32 "loss": "focal_loss", // loss function
33 "metrics": [ // list of metrics to evaluate
34 "precision",
35 "recall",
36 "f1_score"
37 ],
38 "lr_scheduler": {
39 "type": "ExponentialLR", // learning rate scheduler
40 "args": {
41 "gamma": 0.998
42 }
43 },
44 "trainer": {
45 "epochs": 500, // number of training epochs
46 "adaptive_step": 5, // update dataset after every adaptive_step epochs
47
48 "save_dir": "saved/",
49 "save_period": 1, // save checkpoints every save_period epochs
50 "verbosity": 2, // 0: quiet, 1: per epoch, 2: full
51
52 "monitor": "min val_loss", // mode and metric for model performance monitoring. set 'off' to disable.
53 "early_stop": 50, // early stop
54
55 "tensorboard": true // enable tensorboard visualization
56 }
57}.json config files, then run:python train.py --config config.jsonpython train.py --resume path/to/checkpointn_gpu argument of the config file to larger number.
If configured to use smaller number of gpu than available, first n devices will be used by default.
Specify indices of available GPUs by cuda environmental variable.python train.py --device 2,3 -c config.jsonCUDA_VISIBLE_DEVICES=2,3 python train.py -c config.py