Skip to content

Commit 8959e7c

Browse files
committed
writer edits
1 parent f956206 commit 8959e7c

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

articles/cognitive-services/Computer-vision/how-to/model-customization.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,24 @@ This guide shows you how to create and train a custom image classification model
3030
3131
#### [Python](#tab/python)
3232

33-
You can run through all of the model customization steps using a configured Jupyter Notebook.
33+
Train your own image classifier (IC) or object detector (OD) with your own data using Image Analysis model customization and Python.
34+
35+
You can run through all of the model customization steps using a Python sample package. You can run the code in this section using a Python script, or you can download and run the Notebook on a compatible platform.
3436

3537
<!-- nbstart https://raw.githubusercontent.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/main/docs/cognitive_service_vision_model_customization.ipynb -->
3638

3739
> [!TIP]
3840
> Contents of _cognitive_service_vision_model_customization.ipynb_. **[Open in GitHub](https://github.com/Azure-Samples/cognitive-service-vision-model-customization-python-samples/blob/main/docs/cognitive_service_vision_model_customization.ipynb)**.
3941
40-
Train your own image classifier (IC) or object detector (OD) with your own data using Image Analysis model customization and Python.
42+
## Install the python samples package
43+
44+
Install the [sample code](https://pypi.org/project/cognitive-service-vision-model-customization-python-samples/) to train/predict custom models with Python:
45+
46+
```bash
47+
pip install cognitive-service-vision-model-customization-python-samples
48+
```
4149

42-
## Credentials
50+
## Authentication
4351

4452
Enter your Computer Vision endpoint URL and key, as well as the name of the resource, in the code below.
4553

@@ -64,31 +72,20 @@ else:
6472
resource_key = '{specify_your_resource_key}'
6573
```
6674

67-
## Install the python samples package
68-
69-
Install the [sample code](https://pypi.org/project/cognitive-service-vision-model-customization-python-samples/) to train/predict custom models with Python:
70-
71-
72-
```bash
73-
pip install cognitive-service-vision-model-customization-python-samples
74-
```
75-
7675
## Prepare a dataset from Azure blob storage
7776

78-
To train a model with your own dataset, the dataset should be prepared conformed with the COCO format described below, hosted on Azure blob storage, and accessible from your Computer Vision resource.
79-
80-
> [!TIP]
81-
> Quota limit information, including the maximum number of images and categories supported, maximum image size, and so on, can be found on the [concept page](../concept-model-customization.md).
77+
To train a model with your own dataset, the dataset should be arranged in the COCO format described below, hosted on Azure blob storage, and accessible from your Computer Vision resource.
8278

8379
### Dataset annotation format
8480

85-
We use COCO format for indexing/organizing the training images and their annotations. Below are examples and explanations of what specific format is needed for multiclass classification and object detection.
81+
Image Analysis uses the COCO file format for indexing/organizing the training images and their annotations. Below are examples and explanations of what specific format is needed for multiclass classification and object detection.
82+
83+
Image Analysis model customization for classification is different from other kinds of vision training, as we utilize your class names, as well as image data, in training. So, be sure provide meaningful category names in the annotations.
8684

87-
Note that
85+
> [!NOTE]
86+
> In the example dataset, there are few images for the sake of simplicity. Although [Florence models](https://www.microsoft.com/research/publication/florence-a-new-foundation-model-for-computer-vision/) achieve great few-shot performance (high model quality even with little data available), it's good to have more data for the model to learn. Our recommendation is to have at least five images per class, and the more the better.
8887
89-
- Image Analysis model customization for classification is different from other kinds of vision training, as we utilize your class names, as well as image data, in training. So, be sure provide meaningful category names in the annotations.
90-
- Note that in the example dataset, there are few images for the sake of simplicity. Although [Florence models](https://www.microsoft.com/en-us/research/publication/florence-a-new-foundation-model-for-computer-vision/) achieve great few-shot performance (high model quality even with little data available), it's good to have more data for the model to learn. Our recommendation is to have at least five images per class, and the more the better.
91-
- Once your COCO annotation file is prepared, you can use the [COCO file verification script](coco-verification.md) to check the format.
88+
Once your COCO annotation file is prepared, you can use the [COCO file verification script](coco-verification.md) to check the format.
9289

9390
#### Multiclass classification example
9491

@@ -121,7 +118,7 @@ Besides `absolute_url`, you can also use `coco_url` (the system accepts either f
121118
}
122119
```
123120

124-
The values in `bbox: [left, top, width, height]` are relative the image width and height.
121+
The values in `bbox: [left, top, width, height]` are relative to the image width and height.
125122

126123
### Blob storage directory structure
127124

@@ -135,7 +132,10 @@ cat_dog/
135132
train_coco.json
136133
```
137134

138-
### Grant your Computer Vision resource access to your Azure data blob
135+
> [!TIP]
136+
> Quota limit information, including the maximum number of images and categories supported, maximum image size, and so on, can be found on the [concept page](../concept-model-customization.md).
137+
138+
### Grant Computer Vision access to your Azure data blob
139139

140140
You need to take an extra step to give your Computer Vision resource access to read the contents of your Azure blog storage container. There are two ways to do this.
141141

@@ -158,12 +158,11 @@ Below is a series of steps for allowing the system-assigned Managed Identity of
158158

159159
### Register the dataset
160160

161-
Once your dataset has been prepared and hosted on your azure blob storage container, with access granted to your Computer Vision resource, you can register it with the service.
161+
Once your dataset has been prepared and hosted on your Azure blob storage container, with access granted to your Computer Vision resource, you can register it with the service.
162162

163163
> [!NOTE]
164164
> The service only accesses your storage data during training. It doesn't keep copies of your data beyond the training cycle.
165165
166-
167166
```python
168167
from cognitive_service_vision_model_customization_python_samples import DatasetClient, Dataset, AnnotationKind, AuthenticationKind, Authentication
169168

@@ -197,7 +196,7 @@ if eval_dataset:
197196

198197
## Train a model
199198

200-
After you registering the dataset, use it to train a custom model:
199+
After you register the dataset, use it to train a custom model:
201200

202201
```python
203202
from cognitive_service_vision_model_customization_python_samples import TrainingClient, Model, ModelKind, TrainingParameters, EvaluationParameters

0 commit comments

Comments
 (0)