Skip to content

Commit 84d0b48

Browse files
authored
Merge pull request #213043 from Jak-MS/public-move-98809
Public move 98809
2 parents a5269e3 + 3ab9bc8 commit 84d0b48

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

articles/machine-learning/how-to-prepare-datasets-for-automl-images.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ my_training_data_input = Input(
7474
```
7575
---
7676

77+
### Using pre-labeled training data from local machine
78+
If you have previously labeled data that you would like to use to train your model, you will first need to upload the images to the default Azure Blob Storage of your Azure ML Workspace and register it as a [data asset](how-to-create-data-assets.md).
7779

78-
## Using pre-labeled training data
79-
If you have previously labeled data that you would like to use to train your model, you will first need to upload the images to the default Azure Blob Storage of your Azure ML Workspace and register it as a data asset.
80+
The following script uploads the image data on your local machine at path "./data/odFridgeObjects" to datastore in Azure Blob Storage. It then creates a new data asset with the name "fridge-items-images-object-detection" in your Azure ML Workspace.
81+
82+
If there already exists a data asset with the name "fridge-items-images-object-detection" in your Azure ML Workspace, it will update the version number of the data asset and point it to the new location where the image data uploaded.
8083

8184
# [Azure CLI](#tab/cli)
8285
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
@@ -104,12 +107,42 @@ az ml data create -f [PATH_TO_YML_FILE] --workspace-name [YOUR_AZURE_WORKSPACE]
104107
[!Notebook-python[] (~/azureml-examples-v2samplesreorg/sdk/python/jobs/automl-standalone-jobs/automl-image-object-detection-task-fridge-items/automl-image-object-detection-task-fridge-items.ipynb?name=upload-data)]
105108
---
106109

110+
If you already have your data present in an existing datastore and want to create a data asset out of it, you can do so by providing the path to the data in the datastore, instead of providing the path of your local machine. Update the code [above](how-to-prepare-datasets-for-automl-images.md#using-pre-labeled-training-data-from-local-machine) with the following snippet.
111+
112+
# [Azure CLI](#tab/cli)
113+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
114+
115+
Create a .yml file with the following configuration.
116+
117+
```yml
118+
$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
119+
name: fridge-items-images-object-detection
120+
description: Fridge-items images Object detection
121+
path: azureml://subscriptions/<my-subscription-id>/resourcegroups/<my-resource-group>/workspaces/<my-workspace>/datastores/<my-datastore>/paths/<path_to_image_data_folder>
122+
type: uri_folder
123+
```
124+
125+
# [Python SDK](#tab/python)
126+
127+
128+
```Python
129+
my_data = Data(
130+
path="azureml://subscriptions/<my-subscription-id>/resourcegroups/<my-resource-group>/workspaces/<my-workspace>/datastores/<my-datastore>/paths/<path_to_image_data_folder>",
131+
type=AssetTypes.URI_FOLDER,
132+
description="Fridge-items images Object detection",
133+
name="fridge-items-images-object-detection",
134+
)
135+
```
136+
---
137+
107138
Next, you will need to get the label annotations in JSONL format. The schema of labeled data depends on the computer vision task at hand. Refer to [schemas for JSONL files for AutoML computer vision experiments](reference-automl-images-schema.md) to learn more about the required JSONL schema for each task type.
108139

109140
If your training data is in a different format (like, pascal VOC or COCO), [helper scripts](https://github.com/Azure/azureml-examples/blob/v2samplesreorg/v1/python-sdk/tutorials/automl-with-azureml/image-object-detection/coco2jsonl.py) to convert the data to JSONL are available in [notebook examples](https://github.com/Azure/azureml-examples/blob/v2samplesreorg/sdk/python/jobs/automl-standalone-jobs).
110141

142+
### Using pre-labeled training data from Azure Blob storage
143+
If you have your labeled training data present in a container in Azure Blob storage, then you can access it directly from there by [creating a datastore referring to that container](how-to-datastore.md#create-an-azure-blob-datastore).
111144

112-
### Create MLTable
145+
## Create MLTable
113146

114147
Once you have your labeled data in JSONL format, you can use it to create `MLTable` as shown below. MLtable packages your data into a consumable object for training.
115148

@@ -121,4 +154,4 @@ You can then pass in the `MLTable` as a [data input for your AutoML training job
121154

122155
* [Train computer vision models with automated machine learning](how-to-auto-train-image-models.md).
123156
* [Train a small object detection model with automated machine learning](how-to-use-automl-small-object-detect.md).
124-
* [Tutorial: Train an object detection model (preview) with AutoML and Python](tutorial-auto-train-image-models.md).
157+
* [Tutorial: Train an object detection model (preview) with AutoML and Python](tutorial-auto-train-image-models.md).

0 commit comments

Comments
 (0)