AutoDataset
AutoDataset
#
Source code in focoos/data/auto_dataset.py
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
get_split(augs, split=DatasetSplitType.TRAIN)
#
Generate a dataset for a given dataset name with optional augmentations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
short_edge_length
|
int
|
The length of the shorter edge of the images. |
required |
max_size
|
int
|
The maximum size of the images. |
required |
extra_augs
|
List[Transform]
|
Extra augmentations to apply. |
required |
Returns:
Name | Type | Description |
---|---|---|
MapDataset |
MapDataset
|
A DictDataset with DatasetMapper for training. |
Source code in focoos/data/auto_dataset.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
DatasetAugmentations
dataclass
#
Configuration class for dataset augmentations.
This class defines parameters for various image transformations used in training and validation pipelines for computer vision tasks. It provides a comprehensive set of options for both color and geometric augmentations.
Attributes:
Name | Type | Description |
---|---|---|
resolution |
int
|
Target image size for resizing operations. Range [256, 1024]. Default: 640. |
color_augmentation |
float
|
Strenght of color augmentations. Range [0,1]. Default: 0.0. |
horizontal_flip |
float
|
Probability of applying horizontal flip. Range [0,1]. Default: 0.0. |
vertical_flip |
float
|
Probability of applying vertical flip. Range [0,1]. Default: 0.0. |
zoom_out |
float
|
Probability of applying RandomZoomOut. Range [0,1]. Default: 0.0. |
zoom_out_side |
float
|
Zoom out side range. Range [1,5]. Default: 4.0. |
rotation |
float
|
Probability of applying RandomRotation. 1 equals +/-180 degrees. Range [0,1]. Default: 0.0. |
square |
bool
|
Whether to Square the image. Default: False. |
aspect_ratio |
float
|
Aspect ratio for resizing (actual scale range is (2 ** -aspect_ratio, 2 ** aspect_ratio). Range [0,1]. Default: 0.0. |
scale_ratio |
Optional[float]
|
scale factor for resizing (actual scale range is (2 ** -scale_ratio, 2 ** scale_ratio). Range [0,1]. Default: None. |
max_size |
Optional[int]
|
Maximum allowed dimension after resizing. Range [256, sys.maxsize]. Default: sys.maxsize. |
crop |
bool
|
Whether to apply RandomCrop. Default: False. |
crop_size_min |
Optional[int]
|
Minimum crop size for RandomCrop. Range [256, 1024]. Default: None. |
crop_size_max |
Optional[int]
|
Maximum crop size for RandomCrop. Range [256, 1024]. Default: None. |
Source code in focoos/data/default_aug.py
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
get_augmentations(img_format='RGB', task=None)
#
Generate augmentation pipeline based on configuration.
Source code in focoos/data/default_aug.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|