标签为二值图,后缀为png
- ${your data root}
-- train_images
--- xxx.tif
--- xxx.tif
...
-- train_labels
--- xxx.png
--- xxx.png
...
cd ${your project root}/dataGenerators
python cropUtil.py --dataRoot ${your data root} --outRoot ${your data output root} --targteSize 512 --PaddingSize 128
cd ${your project root}/dataGenerators
python create_connection.py --base_dir D:\MyWorkSpace\dl_dataset\road_extraction\masa\test\png
运行完成后,你的数据根目录如下
- ${your data root}
-- train_images
--- xxx.tif
--- xxx.tif
...
-- train_labels
--- xxx.png
--- xxx.png
...
-- train_connect_8_d1
--- xxx.png
--- xxx.png
...
-- train_connect_8_d3
--- xxx.png
--- xxx.png
...
class Config(object):
#dataset
crop_size = 512
base_size = 640
train_root = ${your data output root}/train_images
valid_output_dir = 'valid_temp'
resume = 'model.pth'
# loss settings
weight = False
# hyper parameters
batch_size = 2
num_workers = 0
num_epochs = 300
model_output = 'ckpts_coanet'
in_chs = 8
### model parameters
num_classes = 1
backbone = "resnet50"
out_stride = 8
sync_bn = False
freeze_bn = False
python train.py
python predict_single.py --img_path 10828795_15_3.png --ckptepoch0023_model.pth