Skip to content

Commit cb5ae0b

Browse files
Merge pull request #222288 from nvijayrania/main
Update how-to-auto-train-image-models.md
2 parents 6a34205 + 9c36029 commit cb5ae0b

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

articles/machine-learning/how-to-auto-train-image-models.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,9 @@ Currently the augmentations defined above are applied by default for an Automate
541541

542542
These two flags are supported via *advanced_settings* under *training_parameters* and can be controlled in the following way.
543543

544-
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
544+
# [Azure CLI](#tab/cli)
545+
546+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
545547

546548
```yaml
547549
training_parameters:
@@ -559,8 +561,50 @@ training_parameters:
559561
advanced_settings: >
560562
{"apply_automl_train_augmentations": false, "apply_mosaic_for_yolo": false}
561563
```
564+
565+
# [Python SDK](#tab/python)
566+
567+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
568+
569+
```python
570+
from azure.ai.ml import automl
571+
572+
image_object_detection_job = automl.image_object_detection(...)
573+
574+
image_object_detection_job.set_training_parameters(
575+
...,
576+
advanced_settings='{"apply_mosaic_for_yolo": false}'
577+
)
578+
```
579+
580+
```python
581+
from azure.ai.ml import automl
582+
583+
image_object_detection_job = automl.image_object_detection(...)
584+
585+
image_object_detection_job.set_training_parameters(
586+
...,
587+
advanced_settings='{"apply_automl_train_augmentations": false}'
588+
)
589+
```
590+
Please note that these two flags are independent of each other and can also be used in combination using the following settings.
591+
592+
```python
593+
from azure.ai.ml import automl
594+
595+
image_object_detection_job = automl.image_object_detection(...)
596+
597+
image_object_detection_job.set_training_parameters(
598+
...,
599+
advanced_settings='{"apply_automl_train_augmentations": false, "apply_mosaic_for_yolo": false}'
600+
)
601+
```
602+
603+
---
604+
562605
In our experiments, we found that these augmentations help the model to generalize better. Therefore, when these augmentations are switched off, we recommend the users to combine them with other offline augmentations to get better results.
563606

607+
564608
## Incremental training (optional)
565609

566610
Once the training run is done, you have the option to further train the model by loading the trained model checkpoint. You can either use the same dataset or a different one for incremental training.

0 commit comments

Comments
 (0)