Create a Dataset from a Zip File

You can now create a dataset, add labels, and upload images to the dataset, all in a single API call. When you pass a compressed .zip file to the API, the dataset name, label names, and image names are generated from the .zip file structure. The .zip file can be located in the cloud or on a local drive.
You can create a dataset in two ways.
  • Call the asynchronous API, and then query the status of the upload to determine when it’s complete.
  • Call the synchronous API, and receive a response when the upload is complete.
This cURL command creates a dataset asynchronously.
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "path=http://metamind.io/images/mountainvsbeach.zip" https://api.metamind.io/v1/vision/datasets/upload
After you create the dataset, you can add examples by uploading them in a .zip file. This cURL command adds examples to a dataset.
curl -X PUT -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "path=http://metamind.io/images/mountainvsbeach.zip" https://api.metamind.io/v1/vision/datasets/<DATASET_ID>/upload