datumaro.components.exporter#

Classes

ExportContext([progress_reporter, error_policy])

Method generated by attrs for class ExportContext.

ExportContextComponent(save_dir, save_media, ...)

ExportErrorPolicy()

Exporter(extractor, save_dir, *[, ...])

FailingExportErrorPolicy()

NullExportContext([progress_reporter, ...])

Method generated by attrs for class ExportContext.

class datumaro.components.exporter.ExportErrorPolicy[source]#

Bases: object

report_item_error(error: Exception, *, item_id: Tuple[str, str]) None[source]#

Allows to report a problem with a dataset item. If this function returns, the converter must skip the item.

report_annotation_error(error: Exception, *, item_id: Tuple[str, str]) None[source]#

Allows to report a problem with a dataset item annotation. If this function returns, the converter must skip the annotation.

fail(error: Exception) NoReturn[source]#
class datumaro.components.exporter.FailingExportErrorPolicy[source]#

Bases: ExportErrorPolicy

class datumaro.components.exporter.ExportContext(progress_reporter=None, error_policy=None)[source]#

Bases: object

Method generated by attrs for class ExportContext.

progress_reporter: ProgressReporter#
error_policy: ExportErrorPolicy#
class datumaro.components.exporter.NullExportContext(progress_reporter=None, error_policy=None)[source]#

Bases: ExportContext

Method generated by attrs for class ExportContext.

progress_reporter: ProgressReporter#
error_policy: ExportErrorPolicy#
class datumaro.components.exporter.Exporter(extractor: IDataset, save_dir: str, *, save_media: bool | None = None, image_ext: str | None = None, default_image_ext: str | None = None, save_dataset_meta: bool = False, save_hashkey_meta: bool = False, stream: bool = False, ctx: ExportContext | None = None)[source]#

Bases: CliPlugin

DEFAULT_IMAGE_EXT = None#
classmethod build_cmdline_parser(**kwargs)[source]#
classmethod convert(extractor, save_dir, **options)[source]#
classmethod patch(dataset, patch, save_dir, **options)[source]#
apply()[source]#

Execute the data-format conversion

property can_stream: bool#

Flag to indicate whether the exporter can export the dataset in a stream manner or not.

class datumaro.components.exporter.ExportContextComponent(save_dir: str, save_media: bool, images_dir: str, pcd_dir: str, video_dir: str, crypter: ~datumaro.components.crypter.Crypter = <datumaro.components.crypter.NullCrypter object>, image_ext: str | None = None, default_image_ext: str | None = None, source_path: str | None = None)[source]#

Bases: object

find_image_ext(item: DatasetItem | Image)[source]#
make_image_filename(item, *, name=None, subdir=None)[source]#
make_pcd_filename(item, *, name=None, subdir=None)[source]#
make_pcd_extra_image_filename(item, idx, image, *, name=None, subdir=None)[source]#
make_video_filename(item, *, name=None)[source]#
save_image(item: DatasetItem, *, encryption: bool = False, basedir: str | None = None, subdir: str | None = None, fname: str | None = None)[source]#
save_point_cloud(item: DatasetItem, *, basedir: str | None = None, subdir: str | None = None, fname: str | None = None)[source]#
save_video(item: DatasetItem, *, basedir: str | None = None, subdir: str | None = None, fname: str | None = None)[source]#
property images_dir: str#
property pcd_dir: str#
property save_dir: str#
property save_media: bool#
property crypter: Crypter#
property source_path: str#