You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Contents of _check_coco_annotation.ipynb_. **[Open in GitHub](https://github.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/blob/main/docs/check_coco_annotation.ipynb)**.
20
+
21
+
This notebook demonstrates how to check if the format of your annotation file is correct. First, install the python samples package from the command line:
Then, run the following python code to check the file's format. You can either enter this code in a Python script, or run the [Jupyter Notebook](https://github.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/blob/main/docs/check_coco_annotation.ipynb) on a compatible platform.
28
+
29
+
```python
30
+
from cognitive_service_vision_model_customization_python_samples import check_coco_annotation_file, AnnotationKind, Purpose
Once your COCO file is verified, you're ready to import it to your model customization project. See [Create and train a custom model](model-customization.md) and go to the section on selecting/importing a COCO file—you can follow the guide from there to the end.
46
+
47
+
## Next steps
48
+
49
+
*[Create and train a custom model](model-customization.md)
Copy file name to clipboardExpand all lines: articles/cognitive-services/Computer-vision/how-to/migrate-from-custom-vision.md
+70-3Lines changed: 70 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.author: pafarley
15
15
16
16
You can migrate an existing Azure Custom Vision project to the new Image Analysis 4.0 system. [Custom Vision](../../custom-vision-service/overview.md) is a model customization service that existed before Image Analysis 4.0.
17
17
18
-
This guide uses a Python script to take all of the training data from an existing Custom Vision project (images and their label data) and convert it to a COCO file. You can then import the COCO file into Vision Studio to train a custom model. See [Create and train a custom model](model-customization.md) and go to the section on importing a COCO file—you can follow the guide from there to the end.
18
+
This guide uses Python code to take all of the training data from an existing Custom Vision project (images and their label data) and convert it to a COCO file. You can then import the COCO file into Vision Studio to train a custom model. See [Create and train a custom model](model-customization.md) and go to the section on importing a COCO file—you can follow the guide from there to the end.
19
19
20
20
## Prerequisites
21
21
@@ -24,6 +24,71 @@ This guide uses a Python script to take all of the training data from an existin
24
24
* A Custom Vision resource where an existing project is stored.
25
25
* An Azure Storage resource - [Create one](../../../storage/common/storage-account-create.md?tabs=azure-portal)
26
26
27
+
#### [Jupyter Notebook](#tab/notebook)
28
+
29
+
This notebook exports your image data and annotations from the workspace of a Custom Vision Service project to your own COCO file in a storage blob, ready for training with Image Analysis Model Customization. You can run the code in this section using a custom Python script, or you can download and run the [Notebook](https://github.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/blob/main/docs/export_cvs_data_to_blob_storage.ipynb) on a compatible platform.
> Contents of _export_cvs_data_to_blob_storage.ipynb_. **[Open in GitHub](https://github.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/blob/main/docs/export_cvs_data_to_blob_storage.ipynb)**.
35
+
36
+
37
+
## Install the python samples package
38
+
39
+
Run the following command to install the required python samples package:
Next, provide the credentials of your Custom Vision project and your blob storage container.
48
+
49
+
You need to fill in the correct parameter values. You need the following information:
50
+
51
+
- The name of the Azure Storage account you want to use with your new custom model project
52
+
- The key for that storage account
53
+
- The name of the container you want to use in that storage account
54
+
- Your Custom Vision training key
55
+
- Your Custom Vision endpoint URL
56
+
- The project ID of your Custom Vision project
57
+
58
+
The Azure Storage credentials can be found on that resource's page in the Azure portal. The Custom Vision credentials can be found in the Custom Vision project settings page on the [Custom Vision web portal](https://customvision.ai).
59
+
60
+
61
+
```python
62
+
azure_storage_account_name =''
63
+
azure_storage_account_key =''
64
+
azure_storage_container_name =''
65
+
66
+
custom_vision_training_key =''
67
+
custom_vision_endpoint =''
68
+
custom_vision_project_id =''
69
+
```
70
+
71
+
## Run the migration
72
+
73
+
When you run the migration code, the Custom Vision training images will be saved to a `{project_name}_{project_id}/images` folder in your specified Azure blob storage container, and the COCO file will be saved to `{project_name}_{project_id}/train.json` in that same container. Both tagged and untagged images will be exported, including any **Negative**-tagged images.
74
+
75
+
> [!IMPORTANT]
76
+
> Image Analysis Model Customization does not currently support **multilabel** classification training, buy you can still export data from a Custom Vision multilabel classification project.
77
+
78
+
```python
79
+
from cognitive_service_vision_model_customization_python_samples import export_data
This script requires certain Python libraries. Install them in your project directory with the following command.
@@ -253,10 +318,12 @@ You need to fill in the correct parameter values. You need the following informa
253
318
- The key for that storage account
254
319
- The name of the container you want to use in that storage account
255
320
321
+
---
322
+
256
323
## Use COCO file in a new project
257
324
258
-
The script generates a COCO file and uploads it to the blob storage location you specified. You can now import it to your model customization project. See [Create and train a custom model](model-customization.md) and go to the section on selecting a COCO file—you can follow the guide from there to the end.
325
+
The script generates a COCO file and uploads it to the blob storage location you specified. You can now import it to your Model Customization project. See [Create and train a custom model](model-customization.md) and go to the section on selecting/importing a COCO file—you can follow the guide from there to the end.
259
326
260
327
## Next steps
261
328
262
-
*[Create and train a custom model](model-customization.md)
329
+
*[Create and train a custom model](model-customization.md)
0 commit comments