<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/read_only_builder.py#L169-L195) |

Loads a [`tfds.core.DatasetBuilder`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder) from the given generated dataset path.

    tfds.builder_from_directory(
        builder_dir: epath.PathLike,
        file_format: (str | file_adapters.FileFormat | None) = None
    ) -> dataset_builder.DatasetBuilder

Reconstructs the [`tfds.core.DatasetBuilder`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder) without requiring the original
generation code.

From `<builder_dir>/features.json` it infers the structure (feature names,
nested dict,...) and content (image, sequence,...) of the dataset. The
serialization format is defined in
[`tfds.features.FeatureConnector`](https://www.tensorflow.org/datasets/api_docs/python/tfds/features/FeatureConnector) in `to_json()`.

> [!NOTE]
> **Note:** This function only works for datasets generated with TFDS `4.0.0` or above.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `builder_dir` | Path of the directory containing the dataset to read ( e.g. `~/tensorflow_datasets/mnist/3.0.0/`). |
| `file_format` | The desired file format to use for the dataset. If not specified, the default file format in the DatasetInfo is used. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `builder` | [`tfds.core.DatasetBuilder`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder), builder for dataset at the given path. |

<br />