As mentioned before, Datasets are collections of items (videos or images) that you can then act upon.
Therefore it is important to identify and access these collections so you can work with them.
Datasets are identified by a string, comprised of your team and dataset slugs:
The team slug is the team's name with everything lower-case, removed specials characters and spaces replaced by dashes, e.g.,
bird-species. This string is unique across v7. The dataset slug is the same, except that its slug is only unique within the team it belongs to.
For example, if my team is "v7" and I created a dataset called "my first dataset", its final identifier would be:
With the SDK's
Client module, you can access datasets and their information with the following methods:
Returns an iterator with all the remote datasets you are currently authenticated for.
from darwin.client import Client # Authenticate client = Client.local() # Create a remote dataset dataset = client.create_dataset('my-first-dataset') print(dataset.slug) #List remote datasets remote_datasets = client.list_remote_datasets() for dataset in remote_datasets: print(dataset.slug)
Do have in mind that created datasets are
RemoteDatasets and that invoking
list_local_datasets after creating one will not return it in the list. Instead you should use
List the local datasets on your machine.
Local datasets are folders inside your
To be considered a local dataset folder, the folders must have a name comprised as the identifier of the dataset (
team-slug/dataset-slug) and they must contain two additional folders inside:
releaseswhich contains releases
imageswhich contains the data you want to work on
The following example is a valid local dataset folder:
~/.darwin/datasets/ └── andreas-team └── cats-dataset ├── images └── releases
from darwin.client import Client # Authenticate client = Client.local() #List local datasets local_datasets = client.list_local_datasets() for dataset in local_datasets: print(dataset.name)
Returns the remote dataset with the given identifier.
from darwin.client import Client # Authenticate client = Client.local() # Create a remote dataset dataset = client.create_dataset('my-first-dataset') print(dataset.name) #List remote datasets dataset = client.get_remote_dataset('my-team-slug/my-first-dataset') print(dataset.slug)