Einstein Platform Services

Step 1: Create the Object Detection Dataset

The first step is to create the dataset that contains the training data. You use this dataset to create the model.

You create the dataset from the .zip file called alpine.zip, referenced by its URL. In the following command, replace <TOKEN> with your JWT token and run the command. This command:

  • Creates a dataset called alpine from the specified .zip file
  • Creates three labels specified in the annotations.csv file: Alpine - Oat Cereal, Alpine - Corn Flakes, and Alpine - Bran Cereal
  • Creates an example for each image specified in the annotations file. In this scenario there are 33 examples.
  • Adds the specified labels from the annotations file to each image.

The type parameter specifies that the new dataset is an object detection dataset.

curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "path=https://einstein.ai/images/alpine.zip" -F "type=image-detection" https://api.einstein.ai/v2/vision/datasets/upload
{
  "id": 1004942,
  "name": "alpine",
  "createdAt": "2017-12-11T22:07:32.000+0000",
  "updatedAt": "2017-12-11T22:07:32.000+0000",
  "labelSummary": {
    "labels": []
  },
  "totalExamples": 0,
  "available": false,
  "statusMsg": "UPLOADING",
  "type": "image-detection",
  "language": "N/A",
  "numOfDuplicates": 0,
  "object": "dataset"
}

This call is asynchronous, so you get the dataset ID back right away, but the API continues to load data into the dataset. Use the call to Get a Dataset to monitor the status of the upload. When available is true and statusMsg is SUCCEEDED, the upload is complete and the dataset is ready to be trained.

This cURL call gets the dataset.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" https://api.einstein.ai/v2/vision/datasets/<DATASET_ID>
{
    "id": 1004942,
    "name": "alpine",
    "createdAt": "2017-12-07T22:54:41.000+0000",
    "updatedAt": "2017-12-07T22:54:44.000+0000",
    "labelSummary": {
        "labels": [
            {
                "id": 39688,
                "datasetId": 1004942,
                "name": "Alpine - Oat Cereal",
                "numExamples": 32
            },
            {
                "id": 39689,
                "datasetId": 1004942,
                "name": "Alpine - Corn Flakes",
                "numExamples": 30
            },
            {
                "id": 39690,
                "datasetId": 1004942,
                "name": "Alpine - Bran Cereal",
                "numExamples": 31
            }
        ]
    },
    "totalExamples": 33,
    "totalLabels": 3,
    "available": true,
    "statusMsg": "SUCCEEDED",
    "type": "image-detection",
    "language": "N/A",
    "numOfDuplicates": 0,
    "object": "dataset"
}

The .zip file used to create an object detection dataset must contain the images and an annotations.csv file. The .zip file must have a specific structure, and the annotations.csv file must also be in the required format.

See the Object Detection Datasets section in Create a Dataset From a Zip File Asynchronously for guidelines about the .zip file and the annotations file.

Updated 32 minutes ago

Step 1: Create the Object Detection Dataset


The first step is to create the dataset that contains the training data. You use this dataset to create the model.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.