Creating a Dataset

Create a dataset to be used for training

Uploading Files to Hume

curl --location '<https://api.hume.ai/v0/registry/files'>  
--header 'X-Hume-Api-Key: <YOUR API KEY>'  
--header 'Content-Type: application/json'  
--data '[  
  {  
    "file": {  
      "name": "<NAME OF FILE>",  
      "uri": "<URI OF FILE>",  
      "hume_storage": true,  
      "data_type": "image/png",  
      "metadata": {}  
    }  
  }  
]'

Response

[  
    {  
        "file": {  
            "id": "9f045781-3ecd-4f34-ba9c-969139c32256",  
            "name": "<NAME OF FILE>",  
            "uri": "<URI OF FILE>,  
            "upload_uri": null,  
            "thumbnail_uri": null,  
            "user_id": "<YOUR USER ID>",  
            "data_type": "image/png",  
            "created_on": 1695851622,  
            "modified_on": 1695851622,  
            "metadata": {},  
            "hume_storage": true,  
            "hume_storage_upload_timestamp": null  
        },  
        "attributes": []  
    }  
]

Making your label file

We will create a CSV that has a column for the file_ids and another column for labels.
A file_id column and a labels column are required. The labels column can be named in the context relevant to you and your data. For us we'll call it expressions.
We will add a column for our readability named file_name.

Here is how our csv will look like.

file_namefile_idexpressions
neutral_face.jpegb3cd5662-ea89-4f00-8eae-86218a556027Neutral
postive_face.jpeg44bc2ac8-41d5-401e-8c88-df179b993be7Positive

Building the Dataset

Now that we have everything ready we can create our dataset

curl --location '<https://api.hume.ai/v0/registry/datasets'>  
--header 'X-Hume-Api-Key:<YOUR API KEY>'  
--form 'name="Negative, Neutral, & Positive Facial Expressions"'  
--form 'labels_file=@"<Path TO LABEL FILE>/labelsFile.csv"'

Success!
Now we have created our dataset.

{  
    "id": "8d6ddf39-d9ff-4f9c-9dbe-d6e288d8ddd7",  //Dataset ID
    "name": "Negative, Neutral, & Positive Facial Expressions",  
    "latest_version": {  
        "id": "d153f723-8a13-48d2-ba74-2a6c333ff0db",  //Dataset Version ID  
        "labels_file_uri": [URI to Labels File],  
        "dataset_id": "8d6ddf39-d9ff-4f9c-9dbe-d6e288d8ddd7",  
        "dataset_version": 0,  
        "created_on": 1695854279  
    },  
    "modified_on": 1695854279,  
    "metadata": null  
}