Client

Picsellia SDK Client shall be used to communicate with Picsellia services.

You need an API Token, available on web platform.

Examples

client = Client(api_token="a0c9f3bbf7e8bc175494fc44bfc6f89aae3ebcd0", "https://app.picsellia.com")

Attributes

Methods:


create_dataset

Signature

create_dataset(
   name: str, data: Union[Data, List[Data], MultiData], version: str = 'first',
   description: str = '', private: bool = True, nb_threads: int = 20
)

Description

Create a Dataset in this organization.

This methods allows user to create a dataset into the organization currently connected.
A dataset takes Data coming from organization's Datalake and transform it as annotable Picture.
User can specify name of the first version, a description and if the dataset is private or not.

Examples

Create a dataset named datatest with data from datalake

    data = datalake.fetch_data()
    ds = client.create_dataset('datatest', data)

Arguments

  • name (str) : Name of the dataset. It must be unique in the organization.

  • data (Data or MultiData) : A bunch of data to be added to the dataset

  • version (str, optional) : Name of the first version. Defaults to 'first'.

  • description (str, optional) : A description of the dataset. Defaults to ''.

  • private (bool, optional) : Specify if the dataset is private. Defaults to True.

Returns

A Dataset that you can manipulate, connected to Picsellia


get_deployment_by_id

Signature

get_deployment_by_id(
   id: str
)

Description

Get a (Deployment) from its name.

Examples

    deployment = client.get_deployment_id(
        id="YOUR DEPLOYMENT ID"
    )

Arguments

  • id (str) : deployment id displayed in your deployment settings.

Returns

A (Deployment) object connected and authenticated to all the services.


get_organization

Signature

get_organization()

Description

Retrieve organization information currently connected

Examples

organization = client.get_organization()

Returns

The Organization of the client that you are using


get_model_by_id

Signature

get_model_by_id(
   id: str
)

Description

Retrieve a model by its id

Examples

model = client.get_model_by_id("d8fae655-5c34-4a0a-a59a-e49c89f20998")

Arguments

  • id (str) : id of the model that you are looking for

Returns

A Model object that you can manipulate


get_project_by_id

Signature

get_project_by_id(
   project_id: str
)

Description

Get a project from its id

Retrieve a project from its id.
Project must belong to used organization.
If no project is found, will throw a ResourceNotFoundError

Examples

    my_project = client.get_project("2214aacc-b884-41e1-b70f-420c0cd7eefb")

Arguments

  • project_id (str) : id of the project to retrieve

Returns

A Project of your organization, you can manipulate to run experiments, or attach dataset


list_datasets

Signature

list_datasets()

Description

Retrieve all dataset of current organization

Examples

datasets = client.list_datasets()

Returns

A list of Dataset object that belongs to your organization


get_datalake

Signature

get_datalake()

Description

Retrieve datalake information of organization currently connected

Examples

datalake = client.get_datalake()

Returns

The Datalake of the client that you are using


get_model

Signature

get_model(
   name: str
)

Description

Retrieve a model by its name.

Examples

    model = client.get_model("foo_model")

Arguments

  • name (str) : name of the model your are looking for

Returns

A Model object that you can manipulate


list_projects

Signature

list_projects()

Description

List all projects of your organization.

Retrieve all projects of your organization

Examples

    projects = client.list_projects()

Returns

A list of Project of your organization


search_datasets

Signature

search_datasets(
   name: str = None, version: str = None
)

Description

Retrieve all dataset of current organization.

Specifying name and/or version allows user to filter results.

Examples

datasets = client.search_datasets()
datasets = client.search_datasets(name="datatest")
datasets = client.search_datasets(version="latest")
datasets = client.search_datasets(name="datatest", version="latest")

Returns

A list of Dataset objects that belongs to your organization, with given name and/or version


get_deployment

Signature

get_deployment(
   name: str
)

Description

Get a (Deployment) from its name.

Examples

    deployment = client.get_deployment(
        name="awesome-deploy"
    )

Arguments

  • name (str) : auto-generated name of your deployment.

Returns

A (Deployment) object connected and authenticated to all the services.


get_dataset

Signature

get_dataset(
   name: str, version: str = 'latest'
)

Description

Get a dataset by its name and version

Examples

dataset = client.get_dataset('datatest', 'first')

Arguments

  • name (str) : Name of the dataset

  • version (str, optional) : Version of the dataset. Defaults to "latest".

Returns

A Dataset that you can use and manipulate


list_models

Signature

list_models()

Description

List all models stored in this organization

This will return all the models stored
If no project is found, will throw a ResourceNotFoundError

Examples

models = client.list_models()

Returns

A list of all Model that belong to this organization


create_project

Signature

create_project(
   name: str, description: str = None, dataset: Dataset = None
)

Description

Create a project with given name and parameters

This project will be registered into used organization.
You can specify this kwargs to build project :

  • description

Examples

    foo_dataset = client.get_dataset("foo", "v1") 
    my_project = client.create_project("my_project", description="My first project!", foo_dataset)

Arguments

  • name (str) : name of the project

  • description (str) : description of the project

  • dataset Dataset : dataset attached to this project

Returns

A Project that you can manipulate to run experiments, or attach dataset


list_deployments

Signature

list_deployments()

Description

List all (Deployment) of your organization

Examples

    our_deployments = client.list_deployments()

Arguments

  • id (str) : deployment id displayed in your deployment settings.

Returns

  • of (Deployment) : all deployments object connected and authenticated to all the services.

get_project

Signature

get_project(
   project_name: str
)

Description

Get a project from its name

Retrieve a project from its name.
Project must belong to used organization.
If no project is found, will throw a ResourceNotFoundError

Examples

    my_project = client.get_project("my_project")

Arguments

  • project_name (str) : name of the project to retrieve

Returns

A Project of your organization, you can manipulate to run experiments, or attach dataset


create_model

Signature

create_model(
   name: str, type: str
)

Description

Creates a new model.

Arguments

  • name (str) : Model name to create.

  • type (str) : Model type (classification, detection, segmentation).

Returns

A Model object that you can manipulate


get_dataset_by_id

Signature

get_dataset_by_id(
   id: str
)

Description

Get a dataset by its id

Examples

dataset = client.get_dataset('918351d2-3e96-4970-bb3b-420f33ded895')

Arguments

  • id (str) : id of the dataset to retrieve

Returns

A Dataset that you can use and manipulate