Here is an example of creating a new dataset and uploading images to it with categories and annotations.
#Create a dataset
#Create a category
When using the API to upload images from categories, you will need to create the categories you need in advance so that when you upload images, you provide the correct id of the categories used in the dataset.
#Upload
#Start and end of upload
You must start the upload manually. The dataset will then be locked and you will be able to upload photos. Once you have finished uploading photos, you need to stop uploading to unlock the dataset. If you forget to do this, the dataset will automatically unlock itself after a certain period of time of not receiving new photos.
Photos are sent as multipart/form-data
, which must include:
DatasetID
DatasetUploadID
ImagsMetadata - containing data such as:
- name
- annotationType
- annotation
- classifyCategoryId
ImagesFles
#Get image metadata
To make it easier to manage uploaded images, you can break down information about a photo by uploading classifications and annotations to it.
In this example, we use the parent folder to assign the classification.
The .xml files require that the metadata for the images include a valid annotationType
so that the server will know how to decode the information it has. The .xml file should be uploaded as a encoded string in base64.