1. Setup¶
SLEAP uses deep neural networks to learn how to predict poses from data. Training these models is much faster when using a GPU1 for acceleration.
If you know you have a GPU on your machine or have a Mac with Apple Silicon, you can install SLEAP locally and follow along this tutorial.
Install SLEAP locally¶
See the main SLEAP installation instructions for detailed installation instructions.
If you have either a Linux or Windows laptop with a GPU, or a Mac with Apple Silicon, SLEAP will work natively with hardware acceleration.
-
Make sure that you have Miniforge installed.
You can also use Miniconda or vanilla Anaconda, but we recommend Miniforge since it is much faster to resolve dependencies, thus making the installation much faster. If you use Anaconda, replace
mamba
withconda
in the commands below.To install Miniforge:
Open a new PowerShell terminal (does not need to be admin) and enter:
Invoke-WebRequest -Uri "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe" -OutFile "$env:UserProfile/Downloads/Miniforge3-Windows-x86_64.exe"; Start-Process -FilePath "$env:UserProfile/Downloads/Miniforge3-Windows-x86_64.exe" -ArgumentList "/InstallationType=JustMe /RegisterPython=1 /S" -Wait; Remove-Item -Path "$env:UserProfile/Downloads/Miniforge3-Windows-x86_64.exe"
Open a new terminal and enter:
curl -fsSL --compressed https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o "~/Downloads/Miniforge3-Linux-x86_64.sh" && chmod +x "~/Downloads/Miniforge3-Linux-x86_64.sh" && "~/Downloads/Miniforge3-Linux-x86_64.sh" -b -p ~/miniforge3 && rm "~/Downloads/Miniforge3-Linux-x86_64.sh" && ~/miniforge3/bin/conda init "$(basename "${SHELL}")" && source "$HOME/.$(basename "${SHELL}")rc"
Open a new terminal and enter:
curl -fsSL --compressed https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh -o "~/Downloads/Miniforge3-MacOSX-arm64.sh" && chmod +x "~/Downloads/Miniforge3-MacOSX-arm64.sh" && "~/Downloads/Miniforge3-MacOSX-arm64.sh" -b -p ~/miniforge3 && rm "~/Downloads/Miniforge3-MacOSX-arm64.sh" && ~/miniforge3/bin/conda init "$(basename "${SHELL}")" && source "$HOME/.$(basename "${SHELL}")rc"
Open a new terminal and enter:
curl -fsSL --compressed https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh -o "~/Downloads/Miniforge3-MacOSX-x86_64.sh" && chmod +x "~/Downloads/Miniforge3-MacOSX-x86_64.sh" && "~/Downloads/Miniforge3-MacOSX-x86_64.sh" -b -p ~/miniforge3 && rm "~/Downloads/Miniforge3-MacOSX-x86_64.sh" && ~/miniforge3/bin/conda init "$(basename "${SHELL}")" && source "$HOME/.$(basename "${SHELL}")rc"
-
Install SLEAP in a new environment.
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.3
mamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.3.3
-
Graphics processing unit. This is a hardware component that parallelizes computations across thousands of cores, making them particularly effective for the algorithms used to train deep neural networks. ↩