Installation¶
Installation may follow one of three paths: deployment or development for CPU-only execution, or a mixed development and deployment environment with Nvidia CUDA support. Choose the relevant tab for details on each of those installation paths.
Install using pip, or your preferred Python project management solution (e.g. uv, rye or poetry).
Stable release, from PyPI:
pip install sleepless
Latest development branch, from its git repository:
pip install git+https://gitlab.idiap.ch/medai/software/sleepless@main
Checkout the repository, and then use pixi to setup a full development environment:
git clone git@gitlab.idiap.ch:medai/software/sleepless
pixi install --frozen
pixi run sleepless --help
Tip
The --frozen flag will ensure that the latest lock-file available
with sources is used. If you’d like to update the lock-file to the
latest set of compatible dependencies, remove that option.
If you use direnv to setup your pixi environment
when you enter the directory containing this package, you can use a
.envrc file similar to this:
watch_file pixi.lock
export PIXI_FROZEN="true"
eval "$(pixi shell-hook)"
Checkout the repository, and then use pixi to setup a version of this package that can run on a CUDA-enabled machine:
git clone git@gitlab.idiap.ch:medai/software/sleepless
pixi install --frozen -e cuda
pixi run -e cuda sleepless --help
To enable CUDA support, always run applications using the cuda
environment via pixi run -e cuda .... Refer to further pixi
configuration tips on the Development tab above.
Setup¶
A configuration file may be useful to setup global options that should be often
reused. The location of the configuration file depends on the value of the
environment variable $XDG_CONFIG_HOME, but defaults to
~/.config/sleepless.toml. You may edit this file using your preferred
editor.
Here is an example configuration file that may be useful as a starting point:
[datadir]
EDF = "/Users/myself/dbs/EDF"
MASS = "/Users/myself/dbs/MASS"
Tip
To get a list of valid data directories that can be configured, execute:
sleepless dataset list
You must procure and download datasets by yourself. The raw data is not included in this package as we are not authorised to redistribute it.
To check whether the downloaded version is consistent with the structure that is expected by this package, run:
sleepless dataset check EDF
Supported Datasets¶
Here is a list of currently supported datasets in this package, alongside notable properties. Each dataset name is linked to the location where raw data can be downloaded.
Datasets |
EEG channels |
EOG channels |
EMG channels |
Annotation method |
Train |
Validation |
Test |
Reference |
|---|---|---|---|---|---|---|---|---|
ST-EDF |
3 |
1 |
1 |
R&K |
28 |
8 |
8 |
|
SC-EDF |
3 |
1 |
1 |
R&K |
97 |
28 |
28 |
|
_SS3-MASS |
20 |
2 |
3 |
AASM |
33 |
10 |
10 |