Note : Use Python 3.6 or newer
Use Pytorch 1.7.1 or newer
- Download kaggle intel datasets
- Use folder_rename in utils/data_preprocess.py to label each class folder.
The train/test dataset directory structure is like following(folder name: label-class):
.
├── seg_train
│ ├── 0-buildings
│ │ ├── 0.jpg
│ │ ├── 4.jpg
│ │ ├── ...
│ │ └── 20054.jpg
│ ├── 1-forest
│ │ ├── 8.jpg
│ │ ├── 23.jpg
│ │ ├── ...
│ │ └── 20051.jpg
│ ...
│ ├── 5-street
│ │ ├── 8.jpg
│ │ ├── 23.jpg
│ │ ├── ...
│ │ └── 20051.jpg
└── seg_test
├── 0-buildings
│ ├── 20057.jpg
│ ├── 20060.jpg
│ ├── ...
│ └── 24322.jpg
├── 1-forest
│ ├── 20056.jpg
│ ├── 20062.jpg
│ ├── ...
│ └── 24324.jpg
...
└── 5-street
├── 20066.jpg
├── 20067.jpg
├── ...
└── 24332.jpg
- Train (Use absolute path if have any path error)
- Using single GPU:
modify yaml file path in tools/train.py as '../cfg/mobilenet_v2/intel_bs256.yml' and run train.py in IDE.
or run in terminal directly:
python tools/train.py --yml ./cfg/mobilenet_v2/intel_bs256.yml
- Using multiple GPUs(DDP train mode):
modify yaml file path in tools/train.py as '../cfg/mobilenet_v2/intel_bs1024.yml' and run train.py in IDE.
- Infer (Use absolute path if have any path error)
modify test.model_path as your weights path in yaml file you use.
modify yaml file path in tools/infer.py as '../cfg/mobilenet_v2/intel_bs256.yml' and run infer.py
or run in terminal directly:
python tools/infer.py --yml ./cfg/mobilenet_v2/intel_bs256.yml
- Use TensorboardX
tensorboard --logdir=log_dir
TensorBoard 2.6.0 at http://localhost:6006/