Plugins
DeciClient
A client to deci platform and model zoo. requires credentials for connection
Source code in latest/src/super_gradients/common/plugins/deci_client.py
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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
|
download_and_load_model_additional_code(model_name, target_path, package_name='deci_model_code')
try to download code files for this model. if found, code files will be placed in the target_path/package_name and imported dynamically
Source code in latest/src/super_gradients/common/plugins/deci_client.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
get_model_arch_params(model_name)
Get the model arch_params from DeciPlatform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name |
str
|
Name of the model as saved in the platform. |
required |
Returns:
Type | Description |
---|---|
Optional[DictConfig]
|
arch_params. None if arch_params were not found for this specific model on this SG version. |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
get_model_recipe(model_name)
Get the model recipe from DeciPlatform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name |
str
|
Name of the model as saved in the platform. |
required |
Returns:
Type | Description |
---|---|
Optional[DictConfig]
|
recipe. None if recipe were not found for this specific model on this SG version. |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
133 134 135 136 137 138 139 140 141 142 143 144 |
|
get_model_weights(model_name)
Get the path to model weights (downloaded locally).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name |
str
|
Name of the model as saved in the platform. |
required |
Returns:
Type | Description |
---|---|
Optional[str]
|
model_weights path. None if weights were not found for this specific model on this SG version. |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
146 147 148 149 150 |
|
is_model_benchmarking(name)
Check if a given model is still benchmarking or not.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The mode name. |
required |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
231 232 233 234 235 236 |
|
load_code_from_zipfile(*, file, target_path, package_name='deci_model_code')
staticmethod
Load additional code files. The zip file is extracted, and code files will be placed in the target_path/package_name and imported dynamically,
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
str
|
path to zip file to extract code files from. |
required |
target_path |
str
|
path to place code files. |
required |
package_name |
str
|
name of the package to place code files in. |
'deci_model_code'
|
Source code in latest/src/super_gradients/common/plugins/deci_client.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
register_experiment(name, model_name, resume)
Registers a training experiment in Deci's backend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the experiment to register |
required |
model_name |
str
|
Name of the model architecture to connect the experiment to |
required |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
238 239 240 241 242 243 244 245 246 247 248 |
|
save_experiment_file(file_path)
Uploads a training related file to Deci's location in S3. This can be a TensorBoard file or a log
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
The local path of the file to be uploaded |
required |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
250 251 252 253 254 255 |
|
upload_file_to_s3(tag, level, from_path)
Upload a file to the platform S3 bucket.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag |
str
|
Tag that will be associated to the file. |
required |
level |
SentryLevel
|
Logging level that will be used to notify the monitoring system that the file was uploaded. |
required |
from_path |
str
|
Path of the file to upload. |
required |
Source code in latest/src/super_gradients/common/plugins/deci_client.py
257 258 259 260 261 262 263 264 265 266 |
|
upload_model(model, name, input_dimensions, target_hardware_types=None, target_quantization_level=None, target_batch_size=None)
This function will upload the trained model to the Deci Lab
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
nn.Module
|
The resulting model from the training process |
required |
name |
str
|
The model's name |
required |
input_dimensions |
Sequence[int]
|
The model's input dimensions |
required |
target_hardware_types |
Optional[List[HardwareType]]
|
List of hardware types to optimize the model for |
None
|
target_quantization_level |
Optional[QuantizationLevel]
|
The quantization level to optimize the model for |
None
|
target_batch_size |
Optional[int]
|
The batch size to optimize the model for |
None
|
Source code in latest/src/super_gradients/common/plugins/deci_client.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
log_detection_results_to_wandb(prediction, show_confidence=True)
Log predictions for object detection to Weights & Biases using interactive bounding box overlays.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction |
ImagesDetectionPrediction
|
The model predictions (a |
required |
show_confidence |
bool
|
Whether to log confidence scores to Weights & Biases or not. |
True
|
Source code in latest/src/super_gradients/common/plugins/wandb/log_predictions.py
49 50 51 52 53 54 55 56 57 58 59 |
|
plot_detection_dataset_on_wandb(detection_dataset, max_examples=None, dataset_name=None, reverse_channels=True)
Log a detection dataset to Weights & Biases Table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
detection_dataset |
DetectionDataset
|
The Detection Dataset (a |
required |
max_examples |
int
|
Maximum number of examples from the detection dataset to plot (an |
None
|
dataset_name |
str
|
Name of the dataset (a |
None
|
reverse_channels |
bool
|
Reverse the order of channels on the images while plotting. |
True
|
Source code in latest/src/super_gradients/common/plugins/wandb/log_predictions.py
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 |
|
visualize_image_detection_prediction_on_wandb(prediction, show_confidence, reverse_channels=False)
Visualize detection results on a single image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prediction |
ImageDetectionPrediction
|
Prediction results of a single image (a |
required |
show_confidence |
bool
|
Whether to log confidence scores to Weights & Biases or not. |
required |
reverse_channels |
bool
|
Reverse the order of channels on the images while plotting. |
False
|
Source code in latest/src/super_gradients/common/plugins/wandb/log_predictions.py
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 |
|
WandBDetectionValidationPredictionLoggerCallback
Bases: Callback
Source code in latest/src/super_gradients/common/plugins/wandb/validation_logger.py
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 |
|
__init__(class_names, max_predictions_plotted=None, post_prediction_callback=None, reverse_channels=True)
A callback for logging object detection predictions to Weights & Biases during training. This callback is logging images on each batch in validation
and accumulating generated images in a wandb.Table
in the RAM. This could potentially cause OOM errors for very large datasets like COCO. In order to
avoid this, it is recommended to explicitly set the parameter max_predictions_plotted
to a small value, thus limiting the number of images logged in
the table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
class_names |
A list of class names. |
required | |
max_predictions_plotted |
Optional[int]
|
Maximum number of predictions to be plotted per epoch. This is set to |
None
|
post_prediction_callback |
Optional[DetectionPostPredictionCallback]
|
|
None
|
reverse_channels |
bool
|
Reverse the order of channels on the images while plotting. |
True
|
Source code in latest/src/super_gradients/common/plugins/wandb/validation_logger.py
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 |
|