Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.8 KB

datasets.rst

File metadata and controls

61 lines (40 loc) · 1.8 KB

Datasets

The :py~pulse2percept.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.
    • :py~pulse2percept.datasets.load_horsager2009: Load the threshold data from [Horsager2009].
    • :py~pulse2percept.datasets.load_nanduri2012: Load the brightness rating data from [Nanduri2012].
  • Dataset fetchers can be used to download larger datasets from a given URL and directly import them into pulse2percept.
    • :py~pulse2percept.datasets.fetch_beyeler2019: Download and load the phosphene drawing dataset from [Beyeler2019].

Note

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 PULSE2PERCEPT_DATA environment 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()

pulse2percept.datasets.load_horsager2009