Processing
ComposeProcessing
Bases: Processing
Compose a list of Processing objects into a single Processing object.
Source code in V3_1/src/super_gradients/training/processing/processing.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
postprocess_predictions(predictions, metadata)
Postprocess the model output predictions.
Source code in V3_1/src/super_gradients/training/processing/processing.py
78 79 80 81 82 83 |
|
preprocess_image(image)
Processing an image, before feeding it to the network.
Source code in V3_1/src/super_gradients/training/processing/processing.py
70 71 72 73 74 75 76 |
|
ImagePermute
Bases: Processing
Permute the image dimensions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
permutation |
Tuple[int, int, int]
|
Specify new order of dims. Default value (2, 0, 1) suitable for converting from HWC to CHW format. |
(2, 0, 1)
|
Source code in V3_1/src/super_gradients/training/processing/processing.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
NormalizeImage
Bases: Processing
Normalize an image based on means and standard deviation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mean |
List[float]
|
Mean values for each channel. |
required |
std |
List[float]
|
Standard deviation values for each channel. |
required |
Source code in V3_1/src/super_gradients/training/processing/processing.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
Processing
Bases: ABC
Interface for preprocessing and postprocessing methods that are used to prepare images for a model and process the model's output.
Subclasses should implement the preprocess_image
and postprocess_predictions
methods according to the specific requirements of the model and task.
Source code in V3_1/src/super_gradients/training/processing/processing.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
postprocess_predictions(predictions, metadata)
abstractmethod
Postprocess the model output predictions.
Source code in V3_1/src/super_gradients/training/processing/processing.py
57 58 59 60 |
|
preprocess_image(image)
abstractmethod
Processing an image, before feeding it to the network. Expected to be in (H, W, C) or (H, W).
Source code in V3_1/src/super_gradients/training/processing/processing.py
52 53 54 55 |
|
ProcessingMetadata
dataclass
Bases: ABC
Metadata including information to postprocess a prediction.
Source code in V3_1/src/super_gradients/training/processing/processing.py
22 23 24 |
|
ReverseImageChannels
Bases: Processing
Reverse the order of the image channels (RGB -> BGR or BGR -> RGB).
Source code in V3_1/src/super_gradients/training/processing/processing.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
preprocess_image(image)
Reverse the channel order of an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
Image, in (H, W, C) format. |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, None]
|
Image with reversed channel order. (RGB if input was BGR, BGR if input was RGB) |
Source code in V3_1/src/super_gradients/training/processing/processing.py
108 109 110 111 112 113 114 115 116 117 118 119 |
|
StandardizeImage
Bases: Processing
Standardize image pixel values with img/max_val
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_value |
float
|
Current maximum value of the image pixels. (usually 255) |
255.0
|
Source code in V3_1/src/super_gradients/training/processing/processing.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
preprocess_image(image)
Reverse the channel order of an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
np.ndarray
|
Image, in (H, W, C) format. |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, None]
|
Image with reversed channel order. (RGB if input was BGR, BGR if input was RGB) |
Source code in V3_1/src/super_gradients/training/processing/processing.py
136 137 138 139 140 141 142 143 |
|
default_ppyoloe_coco_processing_params()
Processing parameters commonly used for training PPYoloE on COCO dataset. TODO: remove once we load it from the checkpoint
Source code in V3_1/src/super_gradients/training/processing/processing.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
|
default_yolo_nas_coco_processing_params()
Processing parameters commonly used for training YoloNAS on COCO dataset. TODO: remove once we load it from the checkpoint
Source code in V3_1/src/super_gradients/training/processing/processing.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
default_yolox_coco_processing_params()
Processing parameters commonly used for training YoloX on COCO dataset. TODO: remove once we load it from the checkpoint
Source code in V3_1/src/super_gradients/training/processing/processing.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
get_pretrained_processing_params(model_name, pretrained_weights)
Get the processing parameters for a pretrained model. TODO: remove once we load it from the checkpoint
Source code in V3_1/src/super_gradients/training/processing/processing.py
331 332 333 334 335 336 337 338 339 340 341 342 |
|