1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
- # PPLiteSeg segmentation training example with Cityscapes dataset.
- # Torch implementation of the paper:
- # Juncai Peng, Yi Liu, Shiyu Tang, Yuying Hao, Lutao Chu, Guowei Chen, Zewu Wu, Zeyu Chen, Zhiliang Yu, Yuning Du,
- # Qingqing Dang,Baohua Lai, Qiwen Liu, Xiaoguang Hu, Dianhai Yu, Yanjun Ma.
- # PP-LiteSeg: A Superior Real-Time Semantic Segmentation Model.
- # Instructions:
- # 0. Make sure that the data is stored in dataset_params.dataset_dir or add "dataset_params.data_dir=<PATH-TO-DATASET>" at the end of the command below (feel free to check ReadMe)
- # 1. Move to the project root (where you will find the ReadMe and src folder)
- # 2. Run the command:
- # PPLite-T-Seg50: python src/super_gradients/examples/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=<stdc1-backbone-pretrained-path> architecture=pp_lite_t_seg
- # PPLite-B-Seg50: python src/super_gradients/examples/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=<stdc2-backbone-pretrained-path> architecture=pp_lite_b_seg
- #
- #
- # Validation mIoU - Cityscapes, training time:
- # PPLite-T-Seg50: input-size: [512, 1024] mIoU: 74.92 4 X RTX A5000, 13 H
- # PPLite-B-Seg50: input-size: [512, 1024] mIoU: 76.48 4 X RTX A5000, 14 H
- #
- # Official git repo:
- # https://github.com/PaddlePaddle/PaddleSeg/
- # Paper:
- # https://arxiv.org/abs/2204.02681
- #
- # Pretrained checkpoints:
- # Backbones- downloaded from the STDC author's official repo.
- # PPLite-T-Seg50, (STDC1-backbone): https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc1_imagenet_pretrained.pth
- # PPLite-B-Seg50, (STDC2-backbone): https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc2_imagenet_pretrained.pth
- #
- # Logs, tensorboards and network checkpoints:
- # PPLite-T-Seg50: https://deci-pretrained-models.s3.amazonaws.com/ppliteseg/cityscapes/pplite_t_seg50/
- # PPLite-B-Seg50: https://deci-pretrained-models.s3.amazonaws.com/ppliteseg/cityscapes/pplite_b_seg50/
- #
- # Learning rate and batch size parameters, using 2 RTX A5000 with DDP:
- # PPLite-T-Seg50: input-size: [512, 1024] initial_lr: 0.01 batch-size: 8 * 4gpus = 32
- # PPLite-B-Seg50: input-size: [512, 1024] initial_lr: 0.01 batch-size: 8 * 4gpus = 32
- #
- # Comments:
- # * ImageNet Pretrained backbones were used.
- defaults:
- - training_hyperparams: cityscapes_default_train_params
- - dataset_params: cityscapes_stdc_seg50_dataset_params
- - checkpoint_params: default_checkpoint_params
- - _self_
- train_dataloader: cityscapes_train
- val_dataloader: cityscapes_val
- architecture: pp_lite_t_seg
- dataset_params:
- train_dataloader_params:
- batch_size: 8
- val_dataloader_params:
- batch_size: 8
- arch_params:
- num_classes: 19
- use_aux_heads: True
- checkpoint_params:
- checkpoint_path:
- load_backbone: True
- load_weights_only: True
- strict_load: no_key_matching
- training_hyperparams:
- sync_bn: True
- loss:
- dice_ce_edge_loss:
- num_classes: 19
- ignore_index: 19
- num_aux_heads: 3
- num_detail_heads: 0
- weights: [ 1., 1., 1., 1. ]
- dice_ce_weights: [ 1., 1. ]
- ce_edge_weights: [ .5, .5 ]
- edge_kernel: 5
- multi_gpu: DDP
- num_gpus: 4
- experiment_name: ${architecture}50_cityscapes
- ckpt_root_dir:
- # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
- hydra:
- run:
- # Set the output directory (i.e. where .hydra folder that logs all the input params will be generated)
- dir: ${hydra_output_dir:${ckpt_root_dir}, ${experiment_name}}
|