<!-- # hard line break macro for HTML -->

# fiftyone.utils.lerobot_export

LeRobotDataset v3 export utilities.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Classes:**

| [`LeRobotDatasetExporter`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter)(export_dir[, ...])   | Exports selected logical episodes as a self-contained v3 dataset.   |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|

### *class* fiftyone.utils.lerobot_export.LeRobotDatasetExporter(export_dir, export_media=None)

Bases: [`BatchDatasetExporter`](fiftyone.utils.data.exporters.md#fiftyone.utils.data.exporters.BatchDatasetExporter)

Exports selected logical episodes as a self-contained v3 dataset.

* **Parameters:**
  * **export_dir** – the destination dataset root
  * **export_media** (*None*) – must be `True`; this is the only mode that
    creates a valid LeRobot dataset

**Attributes:**

| [`supports_media_references`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.supports_media_references)   |    |
|------------------------------------------------------------------------------------------------------------------|----|

**Methods:**

| [`export_samples`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.export_samples)(sample_collection[, progress])   | Exports the given sample collection.                                                                                                                                                            |
|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`close`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.close)(\*args)                                            | Performs any necessary actions after the last sample has been exported.                                                                                                                         |
| [`export_sample`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.export_sample)(\*args, \*\*kwargs)                | Exports the given sample to the dataset.                                                                                                                                                        |
| [`log_collection`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.log_collection)(sample_collection)               | Logs any relevant information about the [`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection) whose samples will be exported. |
| [`setup`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.setup)()                                                  | Performs any necessary setup before exporting the first sample in the dataset.                                                                                                                  |

#### supports_media_references *= True*

#### export_samples(sample_collection, progress=None)

Exports the given sample collection.

* **Parameters:**
  * **sample_collection** – a
    [`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection)
  * **progress** (*None*) – whether to render a progress bar (True/False), use
    the default value `fiftyone.config.show_progress_bars`
    (None), or a progress callback function to invoke instead

#### close(\*args)

Performs any necessary actions after the last sample has been
exported.

This method is called when the exporter’s context manager interface is
exited, `DatasetExporter.__exit__()`.

* **Parameters:**
  **\*args** – the arguments to `DatasetExporter.__exit__()`

#### export_sample(\*args, \*\*kwargs)

Exports the given sample to the dataset.

* **Parameters:**
  * **\*args** – subclass-specific positional arguments
  * **\*\*kwargs** – subclass-specific keyword arguments

#### log_collection(sample_collection)

Logs any relevant information about the
[`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection) whose samples will
be exported.

Subclasses can optionally implement this method if their export format
can record information such as the
[`fiftyone.core.collections.SampleCollection.info()`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection.info) of the
collection being exported.

By convention, this method must be optional; i.e., if it is not called
before the first call to [`export_sample()`](#fiftyone.utils.lerobot_export.LeRobotDatasetExporter.export_sample), then the exporter must
make do without any information about the
[`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection) (which may not be
available, for example, if the samples being exported are not stored in
a collection).

* **Parameters:**
  **sample_collection** – the
  [`fiftyone.core.collections.SampleCollection`](fiftyone.core.collections.md#fiftyone.core.collections.SampleCollection) whose
  samples will be exported

#### setup()

Performs any necessary setup before exporting the first sample in
the dataset.

This method is called when the exporter’s context manager interface is
entered, `DatasetExporter.__enter__()`.
