# Module: tff.simulation.datasets.flair

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Libraries for loading the FLAIR dataset.

For details on the FLAIR dataset, please see the associated paper:

FLAIR: Federated Learning Annotated Image Repository
Congzheng Song, Filip Granqvist, Kunal Talwar
<https://arxiv.org/abs/2207.08869>

To load the dataset, first call `download_data`, followed by `write_data`. Once
this is done, you can call `load_data` without having to re-download or re-write
the data.

> [!NOTE]
> **Note:** Please ensure that you use the same `data_dir` argument in both `download_data` and `write_data`. Similarly, please ensure that you use the same `cache_dir` in both `write_data` and `load_data`.

## Functions

[`download_data(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/flair/download_data): Downloads and unpacks the raw FLAIR data into a given directory.

[`load_data(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/flair/load_data): Loads the FLAIR dataset.

[`write_data(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/flair/write_data): Writes the raw FLAIR images to a processed dataset format.