Fetch your DataGym.ai Projects including their connected Datasets and images
The Project object in our Python API Wrapper is a representation of the Projects 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 Getting Started page.
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.
projects = client.get_projects()
get_projectsreturns all Projects in a list.
dummy_project = client.get_project_by_name(project_name="Dummy_Project")
get_project_by_namereturns a specific Project by its unique name
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.
'short_description': 'A project that helps to track cars from an arial drone',
'datasets': <List[Dataset] with 1 element>
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.
dataset = project.get_dataset_by_name(dataset_name="<DATASET_NAME>")
get_dataset_by_namereturns a single Dataset or
Noneif no Dataset with the given name was found.
list_of_images = project.get_images()
In some cases you might only be interested in a specific set of images. The
get_images_by_namemethod 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_namereturns 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)