Step 1 - Create the Dataset

The first step is to create the dataset that contains the beach and mountain images. You use this dataset to create the model.

In the following command, replace <TOKEN> with your JWT token and run the command. This command:

  • Creates a dataset called beachvsmountains from the specified .zip file
  • Creates two labels from the .zip file directories: a Beaches label and a Mountains label
  • Creates 49 examples named for the images in the Beaches directory and gives them the Beaches label
  • Creates 50 examples named for the images in the Mountains directory and gives them the Mountains label

If you use the Service, Salesforce may make available certain images to you ("Provided Images"), which are licensed from a third party, as part of the Service. You agree that you will only use the Provided Images in connection with the Service, and you agree that you will not: modify, alter, create derivative works from, sell, sublicense, transfer, assign, or otherwise distribute the Provided Images to any third party.

This call is synchronous, so you'll see a response after all the images have finished uploading. The response contains the dataset ID and name as well as information about the labels and examples.

In this scenario, the API call to create the dataset and upload the image data is synchronous. You can also make an asynchronous call to create a dataset. See Ways to Create a Dataset for more information about when to use the various APIs.

There are other ways to work with datasets using the API. For example, use this command to return a list of all your datasets.

The results look something like this.

To delete a dataset, use the DELETE verb and pass in the dataset ID.

The results look something like this.

After you delete a dataset, use the id to get the status of the deletion. See Get Deletion Status.