Inserting files / media

Inserting CSV

from relevanceai import Client

client = Client(token=YOUR_ACTIVATION_TOKEN)
ds = client.Dataset("california_housing_test")


Easy Inserting Images

documents = [
    "_id": "1",
    "image": "absolute_path_to_image_1",
    "_id": "2",
    "image": "absolute_path_to_image_2",
    "_id": "3",
    "image": "absolute_path_to_image_2",

dataset.insert_documents(documents, media_fields=["image"])

Look below for more advanced methods.

Inserting files (media, images, audios, etc)

list_of_images = ["/user/me/image_1.png", "/user/me/image_2.png"]


Files inserted this way are stored in Relevance's secure S3. If you are an enterprise this is stored in your designated S3.

When you delete the dataset, all the data will also be deleted off S3.


If you want to just upload the files to S3 but not insert it as documents into the dataset.

list_of_images = ["/user/me/image_1.png", "/user/me/image_2.png"]

docs = ds.host_media_documents(list_of_images)