datasets module provides two kinds of helper
functions that can be used to load datasets from the bionic vision community:
- Dataset loaders can be used to load small datasets that come pre-packaged with the pulse2percept software.
- Dataset fetchers can be used to download larger datasets from a given URL and directly import them into pulse2percept.
You will need Pandas (
pip install pandas) to load the data.
Some datasets also require HDF5 (
pip install h5py).
Local data directory¶
By default, all datasets are downloaded to a directory called ‘pulse2percept_data’ located in the user home directory. This directory is used as a cache so that large datasets don’t have to be downloaded repeatedly.
Alternatively, the directory can be set by a
variable, or passed directly to the fetcher.
You can retrieve the current data directory as follows:
import pulse2percept as p2p p2p.datasets.get_data_dir()
You can delete the folder and all its contents as follows:
import pulse2percept as p2p p2p.datasets.clear_data_dir()
Make sure you have write access to the specified data directory.