Skip to content

pulse2percept/pulse2percept

DOI BSD 3-clause PyPI build GitHub forks GitHub stars

pulse2percept: A Python-based simulation framework for bionic vision

Globally, an estimated 43 million people are blind, with limited treatment options available for many causes of vision loss. For certain conditions, visual neuroprostheses - such as retinal and cortical implants - may be the only viable intervention.

However, understanding the perceptual experience generated by these devices remains a significant challenge. The artificial vision they provide is shaped by complex interactions between neural stimulation, underlying neurophysiology, and device-specific parameters.

pulse2percept (p2p) is an open-source Python package that offers spatiotemporal models of common retinal and cortical implants, providing a computational framework to simulate and study artificial vision.

Input stimulus and predicted percept

(left: input stimulus, right: predicted percept)

Simulations such as the above are likely to be critical for providing realistic estimates of prosthetic vision, thus providing regulatory bodies with guidance into what sort of visual tests are appropriate for evaluating prosthetic performance, and improving current and future technology.

If you use p2p in a scholarly publication, please cite as:

M Beyeler, GM Boynton, I Fine, A Rokem (2017). pulse2percept: A Python-based simulation framework for bionic vision. Proceedings of the 16th Python in Science Conference (SciPy), p.81-88, doi:10.25080/shinma-7f4c6e7-00c.

Installation

Once you have Python 3.9 or later (but not yet 3.13), you can install the stable release of p2p using pip:

pip install pulse2percept

We provide prebuilt wheels for recent versions of macOS (e.g., macOS 14), Linux (e.g., Ubuntu 24.04 LTS), and Windows (e.g., Windows Server 2022). You can find the full documentation here.

Compatibility and Building from Source

While other platforms are not explicitly supported, you may still be able to run p2p with minimal modifications. If pip does not find a prebuilt wheel for your system, it will attempt to install from source.

Note

Building from source requires NumPy and Cython. On Windows, this includes Visual Studio Build Tools.

Supported Python versions:

Python 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4
p2p 0.9 Yes Yes Yes Yes          
p2p 0.8     Yes Yes Yes Yes      
p2p 0.7       Yes Yes Yes Yes    
p2p 0.6         Yes Yes Yes Yes  
p2p 0.5           Yes Yes Yes  

Our GitHub Action Runners ensure that p2p works as expected on macOS 14 Arm64, Ubuntu 24.04, and Windows Server 2022.

Upgrading and Uninstalling

To upgrade p2p to the latest stable version:

pip install -U pulse2percept

To uninstall:

pip uninstall pulse2percept -y

Installing the Bleeding-Edge Version

If you want to install the latest development version from source, first ensure that you have NumPy and Cython installed. On Windows, you will also need Visual Studio Build Tools. Then run:

pip install git+https://github.com/pulse2percept/pulse2percept

For more details, see our Installation Guide.

If you encounter issues, check our Issue Tracker on GitHub for solutions or contribute fixes for unsupported platforms.

Where to go from here