DataGym.ai
  • DataGym.ai
  • Getting Started
  • Project
    • What is a project?
    • Create a new project
    • Update a project
    • Delete a project
    • Connect a dataset
    • Export data
    • Import Data
  • Dataset
    • What is a dataset?
    • Create a new dataset
    • Update a dataset
    • Connect with AWS S3
    • Delete a dataset
    • Manage images
      • Upload to DataGym.ai
      • Add public links
      • Synchronize with AWS S3
    • Connect to a project
    • Use the review mode
  • Label configuration
    • What is a label configuration?
    • Configuration entry
    • Entry types
    • Creating an entry
    • Editing an entry
    • Duplicating an entry
  • Label mode
    • What is the label mode?
    • Entry-list
    • Value-list
    • Task control
    • Toolbar
    • Workspace
    • AI-assisted labeling
    • Video labeling
  • Tasks
    • What is a task?
    • Process a task
    • Manage Tasks
  • AI-Assistant
    • AI-assisted pre-labeling
    • Object Classes
  • API Token
    • API
    • Manage API Token
  • Account-Management
    • Account Settings
    • Organisation-Management
  • Python API
    • Getting Started
    • Projects
    • Labeled data
    • Datasets
    • Images
    • Label configuration
    • Uploading COCO
  • Changelog
Powered by GitBook
On this page
  • Description
  • Fetching Projects from DataGym
  • Get all Projects
  • Get a Project by its name
  • The Project object
  • Project Attributes
  • Project helper methods

Was this helpful?

  1. Python API

Projects

Fetch your DataGym.ai Projects including their connected Datasets and images

PreviousGetting StartedNextLabeled data

Last updated 4 years ago

Was this helpful?

Description

The Project object in our Python API Wrapper is a representation of the you already know from DataGym.ai. This object includes all the data that belongs to your DataGym.ai Project, such as connected Datasets and Images. Projects can be accessed through the Client object introduced in the page.

Fetching Projects from DataGym

Before we look at the Project object in our Python API Wrapper, you first have to learn how to get the data from DataGym.ai. There are multiple ways to get your Projects from DataGym's backend.

Get all Projects

projects = client.get_projects()

get_projects returns all Projects in a list.

Get a Project by its name

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

get_project_by_name returns a specific Project by its unique name

The Project object

Project Attributes

The Project object of the Python API is modeled after DataGym's Projects and, therefore, inherits the same attributes you already know from your Projects.

>>>> print(dummy_project)
<Project {
    'id': 'b1f53633-f3aa-4f9a-9195-a9a651f739df', 
    'name': 'Dummy_Project', 
    'short_description': 'A project that helps to track cars from an arial drone',
    'timestamp': '1583828520411', 
    'label_config_id': 'cdc426e1-0a0d-4f94-9173-4d1dcca10f04', 
    'label_iteration_id': '50ad280c-50ef-408d-8d56-b2661aa54324', 
    'owner': '3360f10f-a5ab-48a6-966c-cdba2d63116a', 
    'datasets': <List[Dataset] with 1 element>
}>

Project helper methods

A Project can hold an arbitrary number of Datasets which also can hold an arbitrary number of images. To simplify the access to these objects, the Project object provides a variety of helper methods.

Get a Dataset by its name

dataset = project.get_dataset_by_name(dataset_name="<DATASET_NAME>")

get_dataset_by_name returns a single Dataset or None if no Dataset with the given name was found.

Get all Images from a Project

list_of_images = project.get_images()

Get Images by name

In some cases you might only be interested in a specific set of images. The get_images_by_name method can reduce the effort of searching for these images with your own scripts. The method takes an image name and returns the image(s) with this exact name within your Project.

images = project.get_images_by_name(image_name="satellite_img_01.jpg")

get_images_by_name returns a list of Images that match the search term

You can also use regular expressions to start a broader search and return all images that fit into a specific naming pattern. For example, let's get all satellite images from your project by searching for the regular expression "satellite.*":

images = project.get_images_by_name(image_name="satellite.*", regex=True)
output
[    
    <Image {
        'id': '<ID_2>', 
        'image_name': 'satellite_img_01.jpg', 
        'image_type': 'SHAREABLE_LINK', 
        'timestamp': 1583831745119
    }>, 
    <Image {
        'id': '<ID_2>', 
        'image_name': 'satellite_img_02.jpg', 
        'image_type': 'SHAREABLE_LINK', 
        'timestamp': 1583831714382
    }>
]

As you can see, a Project object also contains a list of its connected Datasets, which are represented as .

get_images returns a list of all from all Datasets connected to the Project.

Projects
Getting Started
Dataset objects
Images