sleep stage visualizer for real-time EEG sleep experiments

https://github.com/paulzerr/napview
  • automated near-real-time sleep stage classification on live EEG data
  • visualization interface for deep learning based autoscoring
  • displays sleep stage probabilities and other sleep physiology features
  • supports BrainVision and OpenBCI natively, plus any labstreaminglayer-compatible EEG system with real-time signal streaming capabilities
  • is the night shift experimenter's friend

Installation

Option 1: Download NAPVIEW installer (Windows)

The easiest way to use napview on Windows is to download the portable self-extracting installer.

Note: due to the restrictive environment of Windows, you may see a "Search on app store" popup window. Click "No". You may also see the blue Smartscreen warning. In that case click "More info" and then "run anyway". You can also right-click NAPVIEW.exe, go to Properties and tick the box "Unblock". Should this fail, try installing via the standalone archive or pip (see below).


Option 2: Download NAPVIEW standalone (Windows)

Download the zip file, extract it to your preferred location, then double click run_napview.bat. This installation method can be useful on systems without admin priviledges.


Option 3: Install as Python package

First install e.g., Miniconda (an easy way to manage Python environments), and create a new environment.

Windows:

conda create -n napview-env python=3.11 -y
conda activate napview-env

macOS/Linux:

conda create -n napview-env python=3.11 -y
conda activate napview-env

Install NAPVIEW:

pip install napview

Launch NAPVIEW:

conda activate napview-env
napview


Note:
on first run, NAPVIEW may download model weight files via the NIDRA backend.


Graphical user interface (GUI) walkthrough

NAPVIEW graphical user interface

Step 1: Start NAPVIEW

Start NAPVIEW.exe or NAPVIEW.bat, or enter napview in a terminal. A browser tab with the napview control panel should open (per default at 127.0.0.1:8145).

Step 2: Select data source

Step 3: Optional channel configuration

Step 4: Start streaming

Click START napview. A new tab opens with the real-time visualizer (typically at http://127.0.0.1:8245). Sleep stage probabilities stabilize after several minutes of data. Less than 5 minutes of data will likely not result in reliable estimates. A maximum of 15 minutes of past data will be used.

Step 5: Shutdown and save

Once the experiment session is finished, click SHUTDOWN and save to stop the session and write outputs.

Notes

FAQ & troubleshooting

GUI issues

Q: The GUI did not open.
A: Check the terminal output or for the correct URL (normally http://127.0.0.1:8145) and enter it manually in the browser. Otherwise check the logs, which should be in your user directory, e.g. C:\Users\\AppData\Local\napview\data

Q: The visualizer tab is empty or only shows a text message.
A: This usually means the data stream has not started or there is no incoming data. Confirm the data source and check the status panel for red warnings. Otherwise check the logs.

Q: My BrainVision EEG amp does not connect.
A: Verify the RDA plugin is enabled and the IP/port are correct.

Q: Custom LSL stream not found.
A: Ensure the stream is running, the stream name matches exactly, and the stream type is EEG.

How to cite NAPVIEW

If you use NAPVIEW in your research, please cite the NAPVIEW repository and the underlying models.

1. Citing NAPVIEW

Zerr, P. (2025). napview: real-time sleep scoring and analysis visualizer. GitHub. https://github.com/paulzerr/napview

2. Citing U-Sleep

Perslev, M., et al. (2021). U-Sleep: resilient high-frequency sleep staging. NPJ Digital Medicine.

License

This project is released under the BSD-3 Clause License.

Contact

For questions, bug reports, or feedback, please contact Paul Zerr at paul.zerr@donders.ru.nl.