pulse2percept: A Python-based simulation framework for bionic vision
pulse2percept 0.9.2.dev0 documentation
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.
(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
To install the stable release of p2p, run:
pip install pulse2percept
pip installs NumPy and the other dependencies for you, and will only select
a release that supports the Python version you are running (see
Compatibility and Building from Source below).
We publish prebuilt wheels on PyPI for 64-bit Linux (manylinux, x86-64),
macOS 11 and later (both Apple silicon and Intel), and 64-bit Windows. These
wheels are not tied to a particular distribution or OS release beyond those
minimums. You can find the full documentation
here.
Compatibility and Building from Source
We do not publish wheels for 32-bit platforms or for musl-based distributions
such as Alpine Linux. 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
You do not need to install NumPy or Cython yourself in order to build
from source. They are declared as build requirements, so pip installs
them into an isolated build environment automatically. What you do need is
a C compiler: one is already present on most Linux and macOS systems, but
on Windows you must install Visual Studio Build Tools and select
“Desktop development with C++”.
The exception is pip install --no-build-isolation, which deliberately
skips that step; there you must install NumPy and Cython yourself first.
Supported Python versions:
Python |
3.14 |
3.13 |
3.12 |
3.11 |
3.10 |
3.9 |
3.8 |
3.7 |
3.6 |
3.5 |
|---|---|---|---|---|---|---|---|---|---|---|
p2p 0.9.2 |
Yes |
Yes |
Yes |
Yes |
||||||
p2p 0.9.1 |
Yes |
Yes |
Yes |
Yes |
||||||
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 |
Our GitHub Action Runners build and test p2p on the ubuntu-latest,
windows-latest, and macos-latest images, on every Python version listed
for the current release above. Those labels track whatever image GitHub
currently ships, so the exact OS releases we test against change over time.
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, make sure you have a C compiler available (see the note above), 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