Multiasset

Properties




Methods

add_tags

add_tags(
   tags: Union[Tag, list[Tag]]
)

Description

Add some tags to an object. It can be used on Data/MultiData/Asset/MultiAsset/DatasetVersion/Dataset/Model/ModelVersion.

You can give a Tag or a list of Tag.

Examples

tag_bicycle = client.create_tag("bicycle", Target.DATA)
tag_car = client.create_tag("car", Target.DATA)
tag_truck = client.create_tag("truck", Target.DATA)

data.add_tags(tag_bicycle)
data.add_tags([tag_car, tag_truck])

remove_tags

remove_tags(
   tags: Union[Tag, list[Tag]]
)

Description

Remove some tags from an object (can be used on Data/Asset/DatasetVersion/Dataset/Model/ModelVersion)

You can give a Tag or a list of Tag.

Examples

data.remove_tags(tag_bicycle)
data.remove_tags([tag_car, tag_truck])

copy

copy()

Description


split

split(
   ratio: float
)

Description


delete

delete()

Description

Delete assets from their dataset

⚠️ DANGER ZONE: Be very careful here!

Remove these assets and its annotation from the dataset it belongs

Examples

some_assets = dataset.list_assets()[:10]
some_assets.delete()

download

download(
   target_path: Union[str, Path] = './', force_replace: bool = False,
   max_workers: Optional[int] = None, use_id: bool = False
)

Description

Download this multi asset in given target path

Examples

bunch_of_assets = client.get_dataset("foo_dataset").get_version("first").list_assets()
bunch_of_assets.download('./downloads/')

Arguments

  • target_path (str or Path, optional) : Target path where to download. Defaults to './'.

  • max_workers (int, optional) : Number of max workers used to download. Defaults to os.cpu_count() + 4.

  • force_replace : (bool, optional): Replace an existing file if exists. Defaults to False.

  • use_id (bool, optional) : If true, will download file with id and extension as file name. Defaults to False.


delete_annotations

delete_annotations(
   workers: Optional[list[Worker]] = None
)

Description

Delete all annotations of all these assets: it will erase every shape of every annotation of every asset.

Workers parameter is deprecated and cannot be used anymore. It will be removed in 6.27 If given, this method will raise, to prevent unexpected behaviour

⚠️ DANGER ZONE: Be careful here !

Examples

multiple_assets.delete_annotations()

as_list_of_data

as_list_of_data()

Description

Convert a MultiAsset into a List of Data. Assets can come from different Datalake. This is slower than calling .as_multidata(), so if you know that all your data are coming from the same datalake, you should call .as_multidata instead

Returns

A list of Data object


as_multidata

as_multidata(
   force_refresh: bool = True
)

Description

Convert a MultiAsset into a MultiData. Assets must all be in the same datalake to be retrieved. In case of a dataset with multiple datalake source, you can use .as_list_of_data() that will return a list of data but slower

Arguments

  • force_refresh (bool, optional) : when False, will not refresh data by calling platform.

Returns

a MultiData object