Labeled data

Access the labeled data of your DataGym Projects

Export Labels

Fetch your labeled data from a Project:

Wouldn't it be pretty convenient to load the data of our labeled images directly into our python project? In this example we fetch our Dummy Project by providing its name and download the labeled data into our python app. Therefore, we use the export_labels method of the Client that requires the Project ID.

dummy_project = client.get_project_by_name(project_name="Dummy_Project")

labeled_data = client.export_labels(project_id=dummy_project.id) 

export_labels returns the labels as a Python Dictionary that resembles the JSON format introduced in the Export Data section.

You can also generate a hyperlink to the JSON file if you want to download it with your browser or another programmatic solution.

exported_labels_url = client.export_labels_url(project_id=dummy_project.id)

print(exported_labels_url)
Output:
http://app.datagym.ai/api/v1/export/<PROJECT_ID>?token=<API_KEY>

Import Labels

You can not only export your labels but also import annotated image data into your DataGym.ai Project using our Import Label feature.

Visit our Jupyter Notebook on GitHub to learn how to to upload label predictions into DataGym.ai

Use the import_label_data method of the Client class to import labels. The method takes a Project ID and your pre-labeled image data as Dictionary. Visit our API documentation or Jupyter Notebook to learn how to format your labels into a valid JSON format.

project = client.get_project_by_name("<project_name>")

client.import_label_data(project_id=project.id, label_data=label_data)

import_label_data returns a List of Errors if JSON is malformed or data is invalid

Last updated