Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#643 PPYolo-E

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-344-PP-Yolo-E-Training-Replicate-Recipe
1
2
3
4
5
6
7
8
  1. layers: [3, 6, 6, 3] # model's structure
  2. channels: [64, 128, 256, 512, 1024] # number of outputs channels for step and consecutive feature maps
  3. activation: silu # model's width multiplier
  4. return_idx: [1,2,3] # Indexes of feature maps to output
  5. use_large_stem: True # If True, uses 3 conv+bn+act instead of 2 in stem blocks
  6. width_mult: # scaling factor to number of channels
  7. depth_mult: # scaling factor to number of layers
  8. use_alpha: False # If True, enables additional learnable weighting parameter for 1x1 branch in RepVGGBlock
Discard
1
2
3
4
5
  1. defaults:
  2. - csp_resnet_arch_params
  3. depth_mult: 1.0
  4. width_mult: 1.0
Discard
1
2
3
4
5
  1. defaults:
  2. - csp_resnet_arch_params
  3. depth_mult: 0.67
  4. width_mult: 0.75
Discard
1
2
3
4
5
  1. defaults:
  2. - csp_resnet_arch_params
  3. depth_mult: 0.33
  4. width_mult: 0.50
Discard
1
2
3
4
5
  1. defaults:
  2. - csp_resnet_arch_params
  3. depth_mult: 1.33
  4. width_mult: 1.25
Discard
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
  1. depth_mult:
  2. width_mult:
  3. num_classes: 80
  4. backbone:
  5. layers: [ 3, 6, 6, 3 ] # Backbone's structure
  6. channels: [ 64, 128, 256, 512, 1024 ] # Number of outputs channels for stem and consecutive feature maps
  7. activation: silu
  8. return_idx: [ 1, 2, 3 ] # Indexes of feature maps to output, indiced 1,2,3 correspond to feature maps of stride 8,16,32
  9. use_large_stem: True # If True, uses 3 conv+bn+act instead of 2 in stem blocks
  10. use_alpha: False # If True, enables additional learnable weighting parameter for 1x1 branch in RepVGGBlock
  11. pretrained_weights:
  12. neck:
  13. in_channels: [256, 512, 1024]
  14. out_channels: [768, 384, 192]
  15. activation: silu
  16. block_num: 3
  17. stage_num: 1
  18. spp: True
  19. head:
  20. in_channels: [768, 384, 192]
  21. activation: silu
  22. fpn_strides: [32, 16, 8]
  23. grid_cell_scale: 5.0
  24. grid_cell_offset: 0.5
  25. reg_max: 16 # Number of bins for size prediction
  26. eval_size: # Size of the image for evaluation. Setting this value can be beneficial for inference speed since anchors will not be regenerated for each forward call.
Discard
1
2
3
4
5
6
7
8
9
  1. defaults:
  2. - ppyoloe_arch_params
  3. - _self_
  4. depth_mult: 1.0
  5. width_mult: 1.0
  6. backbone:
  7. pretrained_weights: https://deci-pretrained-models.s3.amazonaws.com/ppyolo_e/CSPResNetb_l_pretrained.pth
Discard
1
2
3
4
5
6
7
8
9
  1. defaults:
  2. - ppyoloe_arch_params
  3. - _self_
  4. depth_mult: 0.67
  5. width_mult: 0.75
  6. backbone:
  7. pretrained_weights: https://deci-pretrained-models.s3.amazonaws.com/ppyolo_e/CSPResNetb_m_pretrained.pth
Discard
1
2
3
4
5
6
7
8
9
  1. defaults:
  2. - ppyoloe_arch_params
  3. - _self_
  4. depth_mult: 0.33
  5. width_mult: 0.50
  6. backbone:
  7. pretrained_weights: https://deci-pretrained-models.s3.amazonaws.com/ppyolo_e/CSPResNetb_s_pretrained.pth
Discard
1
2
3
4
5
6
7
8
9
  1. defaults:
  2. - ppyoloe_arch_params
  3. - _self_
  4. depth_mult: 1.33
  5. width_mult: 1.25
  6. backbone:
  7. pretrained_weights: https://deci-pretrained-models.s3.amazonaws.com/ppyolo_e/CSPResNetb_x_pretrained.pth
Discard
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
  1. # PP-Yolo-E Detection training on COCO2017 Dataset:
  2. # PP-Yolo-E trained in 640x640
  3. # Checkpoints + tensorboards: https://deci-pretrained-models.s3.amazonaws.com/ppyoloe_coco/
  4. # Recipe runs with batch size = 20 X 8 gpus = 160.
  5. # Instructions:
  6. # 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)
  7. # 1. Move to the project root (where you will find the ReadMe and src folder)
  8. # 2. Run the command you want:
  9. # ppyoloe_s: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_s
  10. # ppyoloe_m: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_m
  11. # ppyoloe_l: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_l
  12. # ppyoloe_x: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_x
  13. #
  14. # Training times and accuracies (mAP@0.5-0.95 (COCO API, confidence 0.001, IoU threshold 0.6, test on 640x640 images):
  15. # ppyoloe_s: 37h on 8 NVIDIA GeForce RTX 3090, mAP: 42.52 (val)
  16. # ppyoloe_m: 58h on 8 NVIDIA GeForce RTX 3090, mAP: 47.11 (val)
  17. # ppyoloe_l: COMING SOON
  18. # ppyoloe_x: COMING SOON
  19. #
  20. defaults:
  21. - training_hyperparams: coco2017_ppyoloe_train_params
  22. - dataset_params: coco_detection_ppyoloe_dataset_params
  23. - arch_params: ppyoloe_l_arch_params
  24. - checkpoint_params: default_checkpoint_params
  25. - _self_
  26. train_dataloader: coco2017_train_ppyoloe
  27. val_dataloader: coco2017_val_ppyoloe
  28. load_checkpoint: False
  29. resume: False
  30. dataset_params:
  31. train_dataloader_params:
  32. batch_size: 20
  33. training_hyperparams:
  34. resume: ${resume}
  35. mixed_precision: True
  36. initial_lr: 1e-3
  37. architecture: pp_yoloe_l
  38. multi_gpu: DDP
  39. num_gpus: 8
  40. experiment_suffix: ""
  41. experiment_name: coco2017_${architecture}${experiment_suffix}
  42. ckpt_root_dir:
  43. # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
  44. hydra:
  45. run:
  46. # Set the output directory (i.e. where .hydra folder that logs all the input params will be generated)
  47. dir: ${hydra_output_dir:${ckpt_root_dir}, ${experiment_name}}
Discard
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
  1. # PP-Yolo-E Detection training on COCO2017 Dataset:
  2. # PP-Yolo-E trained in 640x640
  3. # Checkpoints + tensorboards: https://deci-pretrained-models.s3.amazonaws.com/ppyoloe_coco/
  4. # Recipe runs with batch size = 24 X 8 gpus = 192.
  5. # Instructions:
  6. # 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)
  7. # 1. Move to the project root (where you will find the ReadMe and src folder)
  8. # 2. Run the command you want:
  9. # ppyoloe_s: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_s
  10. # ppyoloe_m: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_m
  11. # ppyoloe_l: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_l
  12. # ppyoloe_x: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_x
  13. #
  14. # Training times and accuracies (mAP@0.5-0.95 (COCO API, confidence 0.001, IoU threshold 0.6, test on 640x640 images):
  15. # ppyoloe_s: 37h on 8 NVIDIA GeForce RTX 3090, mAP: 42.52 (val)
  16. # ppyoloe_m: 58h on 8 NVIDIA GeForce RTX 3090, mAP: 47.11 (val)
  17. # ppyoloe_l: COMING SOON
  18. # ppyoloe_x: COMING SOON
  19. #
  20. defaults:
  21. - training_hyperparams: coco2017_ppyoloe_train_params
  22. - dataset_params: coco_detection_ppyoloe_dataset_params
  23. - arch_params: ppyoloe_m_arch_params
  24. - checkpoint_params: default_checkpoint_params
  25. - _self_
  26. train_dataloader: coco2017_train_ppyoloe
  27. val_dataloader: coco2017_val_ppyoloe
  28. load_checkpoint: False
  29. resume: False
  30. dataset_params:
  31. train_dataloader_params:
  32. batch_size: 24
  33. training_hyperparams:
  34. resume: ${resume}
  35. mixed_precision: True
  36. initial_lr: 1e-3
  37. architecture: pp_yoloe_m
  38. multi_gpu: DDP
  39. num_gpus: 8
  40. experiment_suffix: ""
  41. experiment_name: coco2017_${architecture}${experiment_suffix}
  42. ckpt_root_dir:
  43. # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
  44. hydra:
  45. run:
  46. # Set the output directory (i.e. where .hydra folder that logs all the input params will be generated)
  47. dir: ${hydra_output_dir:${ckpt_root_dir}, ${experiment_name}}
Discard
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
  1. # PP-Yolo-E Detection training on COCO2017 Dataset:
  2. # PP-Yolo-E trained in 640x640
  3. # Recipe runs with batch size = 32 X 8 gpus = 256.
  4. # Instructions:
  5. # 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)
  6. # 1. Move to the project root (where you will find the ReadMe and src folder)
  7. # 2. Run the command you want:
  8. # ppyoloe_s: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_s
  9. # ppyoloe_m: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_m
  10. # ppyoloe_l: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_l
  11. # ppyoloe_x: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_x
  12. #
  13. # Training times and accuracies (mAP@0.5-0.95 (COCO API, confidence 0.001, IoU threshold 0.6, test on 640x640 images):
  14. # ppyoloe_s: 37h on 8 NVIDIA GeForce RTX 3090, mAP: 42.52 (val)
  15. # ppyoloe_m: 58h on 8 NVIDIA GeForce RTX 3090, mAP: 47.11 (val)
  16. # ppyoloe_l: COMING SOON
  17. # ppyoloe_x: COMING SOON
  18. #
  19. defaults:
  20. - training_hyperparams: coco2017_ppyoloe_train_params
  21. - dataset_params: coco_detection_ppyoloe_dataset_params
  22. - arch_params: ppyoloe_s_arch_params
  23. - checkpoint_params: default_checkpoint_params
  24. - _self_
  25. train_dataloader: coco2017_train_ppyoloe
  26. val_dataloader: coco2017_val_ppyoloe
  27. load_checkpoint: False
  28. resume: False
  29. dataset_params:
  30. train_dataloader_params:
  31. batch_size: 32
  32. training_hyperparams:
  33. resume: ${resume}
  34. mixed_precision: True
  35. architecture: pp_yoloe_s
  36. multi_gpu: DDP
  37. num_gpus: 8
  38. experiment_suffix: ""
  39. experiment_name: coco2017_${architecture}${experiment_suffix}
  40. ckpt_root_dir:
  41. # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
  42. hydra:
  43. run:
  44. # Set the output directory (i.e. where .hydra folder that logs all the input params will be generated)
  45. dir: ${hydra_output_dir:${ckpt_root_dir}, ${experiment_name}}
Discard
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
  1. # PP-Yolo-E Detection training on COCO2017 Dataset:
  2. # PP-Yolo-E trained in 640x640
  3. # Checkpoints + tensorboards: https://deci-pretrained-models.s3.amazonaws.com/ppyoloe_coco/
  4. # Recipe runs with batch size = 16 X 8 gpus = 128.
  5. # Instructions:
  6. # 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)
  7. # 1. Move to the project root (where you will find the ReadMe and src folder)
  8. # 2. Run the command you want:
  9. # ppyoloe_s: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_s
  10. # ppyoloe_m: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_m
  11. # ppyoloe_l: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_l
  12. # ppyoloe_x: python src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ppyoloe_x
  13. #
  14. # Training times and accuracies (mAP@0.5-0.95 (COCO API, confidence 0.001, IoU threshold 0.6, test on 640x640 images):
  15. # ppyoloe_s: 37h on 8 NVIDIA GeForce RTX 3090, mAP: 42.52 (val)
  16. # ppyoloe_m: 58h on 8 NVIDIA GeForce RTX 3090, mAP: 47.11 (val)
  17. # ppyoloe_l: COMING SOON
  18. # ppyoloe_x: COMING SOON
  19. #
  20. defaults:
  21. - training_hyperparams: coco2017_ppyoloe_train_params
  22. - dataset_params: coco_detection_ppyoloe_dataset_params
  23. - arch_params: ppyoloe_x_arch_params
  24. - checkpoint_params: default_checkpoint_params
  25. - _self_
  26. train_dataloader: coco2017_train_ppyoloe
  27. val_dataloader: coco2017_val_ppyoloe
  28. load_checkpoint: False
  29. resume: False
  30. dataset_params:
  31. train_dataloader_params:
  32. batch_size: 16
  33. training_hyperparams:
  34. resume: ${resume}
  35. mixed_precision: True
  36. architecture: pp_yoloe_x
  37. multi_gpu: DDP
  38. num_gpus: 8
  39. experiment_suffix: ""
  40. experiment_name: coco2017_${architecture}${experiment_suffix}
  41. ckpt_root_dir:
  42. # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
  43. hydra:
  44. run:
  45. # Set the output directory (i.e. where .hydra folder that logs all the input params will be generated)
  46. dir: ${hydra_output_dir:${ckpt_root_dir}, ${experiment_name}}
Discard
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
92
93
94
95
96
97
  1. train_dataset_params:
  2. data_dir: /data/coco # root path to coco data
  3. subdir: images/train2017 # sub directory path of data_dir containing the train data.
  4. json_file: instances_train2017.json # path to coco train json file, data_dir/annotations/train_json_file.
  5. input_dim: # None, do not resize dataset on load
  6. cache_dir:
  7. cache: False
  8. transforms:
  9. - DetectionRandomAffine:
  10. degrees: 0 # rotation degrees, randomly sampled from [-degrees, degrees]
  11. translate: 0.25 # image translation fraction
  12. scales: [ 0.5, 1.5 ] # random rescale range (keeps size by padding/cropping) after mosaic transform.
  13. shear: 0.0 # shear degrees, randomly sampled from [-degrees, degrees]
  14. target_size:
  15. filter_box_candidates: True # whether to filter out transformed bboxes by edge size, area ratio, and aspect ratio.
  16. wh_thr: 2 # edge size threshold when filter_box_candidates = True (pixels)
  17. area_thr: 0.1 # threshold for area ratio between original image and the transformed one, when when filter_box_candidates = True
  18. ar_thr: 20 # aspect ratio threshold when filter_box_candidates = True
  19. - DetectionRandomRotate90:
  20. prob: 0.5
  21. - DetectionRGB2BGR:
  22. prob: 0.25
  23. - DetectionHSV:
  24. prob: 0.5 # probability to apply HSV transform
  25. hgain: 18 # HSV transform hue gain (randomly sampled from [-hgain, hgain])
  26. sgain: 30 # HSV transform saturation gain (randomly sampled from [-sgain, sgain])
  27. vgain: 30 # HSV transform value gain (randomly sampled from [-vgain, vgain])
  28. - DetectionHorizontalFlip:
  29. prob: 0.5 # probability to apply horizontal flip
  30. - DetectionMixup:
  31. input_dim:
  32. mixup_scale: [ 0.5, 1.5 ] # random rescale range for the additional sample in mixup
  33. prob: 0.5 # probability to apply per-sample mixup
  34. flip_prob: 0.5 # probability to apply horizontal flip
  35. - DetectionNormalize:
  36. mean: [ 123.675, 116.28, 103.53 ]
  37. std: [ 58.395, 57.12, 57.375 ]
  38. - DetectionTargetsFormatTransform:
  39. max_targets: 256
  40. output_format: LABEL_CXCYWH
  41. tight_box_rotation: False
  42. class_inclusion_list:
  43. max_num_samples:
  44. with_crowd: False
  45. train_dataloader_params:
  46. batch_size: 32
  47. num_workers: 8
  48. shuffle: True
  49. drop_last: True
  50. # Disable pin_memory due to presence of PPYoloECollateFN with uses random resize during training
  51. pin_memory: False
  52. worker_init_fn:
  53. _target_: super_gradients.training.utils.utils.load_func
  54. dotpath: super_gradients.training.datasets.datasets_utils.worker_init_reset_seed
  55. collate_fn: # collate function for trainset
  56. _target_: super_gradients.training.utils.detection_utils.PPYoloECollateFN
  57. random_resize_sizes: [ 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768 ]
  58. random_resize_modes:
  59. - 0 # cv::INTER_NEAREST
  60. - 1 # cv::INTER_LINEAR
  61. - 2 # cv::INTER_CUBIC
  62. - 3 # cv::INTER_AREA
  63. - 4 # cv::INTER_LANCZOS4
  64. val_dataset_params:
  65. data_dir: /data/coco # root path to coco data
  66. subdir: images/val2017 # sub directory path of data_dir containing the train data.
  67. json_file: instances_val2017.json # path to coco train json file, data_dir/annotations/train_json_file.
  68. input_dim:
  69. cache_dir:
  70. cache: False
  71. transforms:
  72. - DetectionRescale:
  73. output_shape: [640, 640]
  74. - DetectionNormalize:
  75. mean: [ 123.675, 116.28, 103.53 ]
  76. std: [ 58.395, 57.12, 57.375 ]
  77. - DetectionTargetsFormatTransform:
  78. max_targets: 256
  79. output_format: LABEL_CXCYWH
  80. tight_box_rotation: False
  81. class_inclusion_list:
  82. max_num_samples:
  83. with_crowd: False
  84. val_dataloader_params:
  85. batch_size: 64
  86. num_workers: 8
  87. drop_last: False
  88. shuffle: False
  89. pin_memory: False
  90. collate_fn: # collate function for trainset
  91. _target_: super_gradients.training.utils.detection_utils.PPYoloECollateFN
  92. _convert_: all
Discard
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
  1. defaults:
  2. - default_train_params
  3. max_epochs: 500
  4. static_assigner_end_epoch: 150
  5. warmup_mode: "linear_batch_step"
  6. warmup_initial_lr: 1e-6
  7. lr_warmup_steps: 1000
  8. lr_warmup_epochs: 0
  9. initial_lr: 2e-3
  10. lr_mode: cosine
  11. cosine_final_lr_ratio: 0.1
  12. zero_weight_decay_on_bias_and_bn: False
  13. batch_accumulate: 1
  14. save_ckpt_epoch_list: [200, 250, 300, 350, 400, 450]
  15. loss:
  16. ppyoloe_loss:
  17. num_classes: ${arch_params.num_classes}
  18. reg_max: ${arch_params.head.reg_max}
  19. optimizer: AdamW
  20. optimizer_params:
  21. weight_decay: 0.0001
  22. ema: True
  23. ema_params:
  24. decay: 0.9997
  25. decay_type: threshold
  26. mixed_precision: False
  27. sync_bn: True
  28. valid_metrics_list:
  29. - DetectionMetrics:
  30. score_thres: 0.1
  31. top_k_predictions: 300
  32. num_cls: ${arch_params.num_classes}
  33. normalize_targets: True
  34. post_prediction_callback:
  35. _target_: super_gradients.training.models.detection_models.pp_yolo_e.PPYoloEPostPredictionCallback
  36. score_threshold: 0.01
  37. nms_top_k: 1000
  38. max_predictions: 300
  39. nms_threshold: 0.7
  40. pre_prediction_callback:
  41. phase_callbacks:
  42. - PPYoloETrainingStageSwitchCallback:
  43. static_assigner_end_epoch: ${training_hyperparams.static_assigner_end_epoch}
  44. metric_to_watch: 'mAP@0.50:0.95'
  45. greater_metric_to_watch_is_better: True
  46. _convert_: all
Discard