Skip to content

Commit

Permalink
Merge branch 'develop' into liezl/add-tracking-score-to-inst
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys authored Feb 4, 2025
2 parents 1ea047d + 59e1f70 commit 5ebf04a
Show file tree
Hide file tree
Showing 221 changed files with 12,806 additions and 5,458 deletions.
21 changes: 21 additions & 0 deletions .conda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This folder defines the conda package build for Linux and Windows. There are runners for both Linux and Windows on GitHub Actions, but it is faster to experiment with builds locally first.

To build, first go to the base repo directory and install the build environment:

```
conda env create -f environment_build.yml -n sleap_build && conda activate sleap_build
```

And finally, run the build command pointing to this directory:

```
conda build .conda --output-folder build -c conda-forge -c nvidia -c https://conda.anaconda.org/sleap/ -c anaconda
```

To install the local package:

```
conda create -n sleap_0 -c conda-forge -c nvidia -c ./build -c https://conda.anaconda.org/sleap/ -c anaconda sleap=x.x.x
```

replacing x.x.x with the version of SLEAP that you just built.
62 changes: 7 additions & 55 deletions .conda/bld.bat
Original file line number Diff line number Diff line change
@@ -1,62 +1,14 @@
@echo off
@REM Install anything that didn't get conda installed via pip.

rem # Install anything that didn't get conda installed via pip.
rem # We need to turn pip index back on because Anaconda turns
rem # it off for some reason. Just pip install -r requirements.txt
rem # doesn't seem to work, tensorflow-gpu, jsonpickle, networkx,
rem # all get installed twice if we do this. pip doesn't see the
rem # conda install of the packages.

rem # Install the pip dependencies and their dependencies. Conda turns of
rem # pip index and dependencies by default so re-enable them. Had to figure
rem # this out myself, ughhh.
@REM We need to turn pip index back on because Anaconda turns it off for some reason.
set PIP_NO_INDEX=False
set PIP_NO_DEPENDENCIES=False
set PIP_IGNORE_INSTALLED=False

pip install numpy==1.19.5
pip install six==1.15.0
pip install imageio==2.15.0
pip install attrs==21.2.0
pip install cattrs==1.1.1
pip install jsonpickle==1.2
pip install networkx
pip install nixio>=1.5.3
@REM pip install tensorflow>=2.6.3,<=2.7.1
@REM pip install h5py>=3.1.0,<=3.6.0
pip install python-rapidjson
@REM pip install opencv-python-headless>=4.2.0.34,<=4.5.5.62
@REM pip install opencv-python @ git+https://github.com/talmolab/wrap_opencv-python-headless.git@ede49f6a23a73033216339f29515e59d594ba921
@REM pip install pandas
pip install psutil
@REM pip install PySide2>=5.13.2,<=5.14.1
pip install pyzmq
pip install pyyaml
pip install imgaug==0.4.0
@REM pip install scipy>=1.4.1,<=1.7.3
pip install scikit-image
pip install scikit-learn==1.0.*
pip install scikit-video
pip install tensorflow-hub
pip install imgstore==0.2.9
pip install qimage2ndarray==1.9.0
pip install jsmin
pip install seaborn
pip install pykalman==0.9.5
pip install segmentation-models==1.0.1
pip install rich==10.16.1
pip install certifi==2021.10.8
pip install pynwb
pip install ndx-pose

rem # Use and update environment.yml call to install pip dependencies. This is slick.
rem # While environment.yml contains the non pip dependencies, the only thing left
rem # uninstalled should be the pip stuff because that is left out of meta.yml
rem conda env update -f=environment.yml

rem # Install requires setuptools-scm
pip install setuptools-scm
@REM Install the pip dependencies. Note: Using urls to wheels might be better:
@REM https://docs.conda.io/projects/conda-build/en/stable/user-guide/wheel-files.html)
pip install --no-cache-dir -r .\requirements.txt

rem # Install sleap itself.
rem # NOTE: This is the recommended way to install packages
@REM Install sleap itself. This does not install the requirements, but will list which
@REM requirements are missing (see "install_requires") when user attempts to install.
python setup.py install --single-version-externally-managed --record=record.txt
58 changes: 15 additions & 43 deletions .conda/build.sh
Original file line number Diff line number Diff line change
@@ -1,51 +1,23 @@
#!/usr/bin/env bash

# Install anything that didn't get conda installed via pip.
# We need to turn pip index back on because Anaconda turns
# it off for some reason. Just pip install -r requirements.txt
# doesn't seem to work, tensorflow-gpu, jsonpickle, networkx,
# all get installed twice if we do this. pip doesn't see the
# conda install of the packages.

# We need to turn pip index back on because Anaconda turns it off for some reason.
export PIP_NO_INDEX=False
export PIP_NO_DEPENDENCIES=False
export PIP_IGNORE_INSTALLED=False

pip install numpy==1.19.5
pip install six==1.15.0
pip install imageio==2.15.0
pip install attrs==21.2.0
pip install cattrs==1.1.1
pip install jsonpickle==1.2
pip install networkx
pip install nixio>=1.5.3
# pip install tensorflow>=2.6.3,<=2.7.1
# pip install h5py>=3.1.0,<=3.6.0
pip install python-rapidjson
# pip install opencv-python-headless==4.5.5.62
# pip install git+https://github.com/talmolab/wrap_opencv-python-headless.git@ede49f6a23a73033216339f29515e59d594ba921
# pip install pandas
pip install psutil
# pip install PySide2>=5.13.2,<=5.14.1
pip install pyzmq
pip install pyyaml
pip install imgaug==0.4.0
# pip install scipy>=1.4.1,<=1.7.3
pip install scikit-image
pip install scikit-learn==1.0.*
pip install scikit-video
pip install tensorflow-hub
pip install imgstore==0.2.9
pip install qimage2ndarray==1.9.0
pip install jsmin
pip install seaborn
pip install pykalman==0.9.5
pip install segmentation-models==1.0.1
pip install rich==10.16.1
pip install certifi==2021.10.8
pip install pynwb
pip install ndx-pose
# Install the pip dependencies. Note: Using urls to wheels might be better:
# https://docs.conda.io/projects/conda-build/en/stable/user-guide/wheel-files.html)
pip install --no-cache-dir -r ./requirements.txt


pip install setuptools-scm
# Install sleap itself. This does not install the requirements, but will list which
# requirements are missing (see "install_requires") when user attempts to install.
python setup.py install --single-version-externally-managed --record=record.txt

python setup.py install --single-version-externally-managed --record=record.txt
# Copy the activate scripts to $PREFIX/etc/conda/activate.d.
# This will allow them to be run on environment activation.
for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/${PKG_NAME}_${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
10 changes: 0 additions & 10 deletions .conda/conda_build_config.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions .conda/condarc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- nvidia
- https://conda.anaconda.org/sleap/label/dev
- sleap
- anaconda
118 changes: 77 additions & 41 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Ref: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html

# Jinja template: Process setup.py to obtain version and metadata
{% set data = load_setup_py_data() %}


Expand All @@ -15,50 +12,89 @@ about:
license: {{ data.get('license') }}
summary: {{ data.get('description') }}

build:
number: 4

source:
path: ../

build:
number: 0

requirements:
host:
- python=3.7
# - sleap::pyside2=5.14.1
- conda-forge::numpy=1.19.5
- sleap::tensorflow=2.6.3
- conda-forge::pyside2=5.13.2
- conda-forge::h5py=3.1.0
- conda-forge::scipy=1.7.3
- conda-forge::six=1.15.0
- pillow=8.4.0
- shapely=1.7.1
- conda-forge::pandas
- ffmpeg
- qtpy>=2.0.1
- conda-forge::pip!=22.0.4
- conda-forge::python ==3.7.12 # Run into _MAX_WINDOWS_WORKERS not found if <
- numpy >=1.19.5,<1.23.0 # Linux likes anaconda, windows likes conda-forge
- conda-forge::cudatoolkit ==11.3.1
- conda-forge::cudnn=8.2.1
- nvidia::cuda-nvcc=11.3
- conda-forge::setuptools
- conda-forge::pip

run:
- python=3.7
- conda-forge::numpy~=1.19.5
- sleap::tensorflow=2.6.3
- conda-forge::pyside2>=5.13.2,<=5.14.1
- conda-forge::h5py~=3.1.0
- conda-forge::scipy>=1.4.1,<=1.7.3
- conda-forge::six~=1.15.0
- pillow=8.4.0
- shapely=1.7.1
# Only the packages above are required to build, but listing them all ensures no
# unnecessary pypi packages are installed via the build script (bld.bat, build.sh)
- conda-forge::attrs ==21.4.0
- conda-forge::cattrs ==1.1.1
- conda-forge::h5py ==3.7.0
- conda-forge::imageio-ffmpeg # Required for imageio to read/write videos with ffmpeg
- conda-forge::jsmin
- conda-forge::jsonpickle ==1.2
- conda-forge::networkx
- conda-forge::opencv <4.9.0
- conda-forge::pandas
- ffmpeg
- qtpy>=2.0.1
- cudatoolkit=11.3.1
- cudnn=8.2.1
- conda-forge::pillow >=8.3.2
- conda-forge::psutil
- conda-forge::pykalman
- conda-forge::pyside2 >=5.12,<5.14
- conda-forge::python-rapidjson
- conda-forge::pyyaml
- conda-forge::pyzmq
- conda-forge::qtpy >=2.0.1
- conda-forge::rich
- conda-forge::scipy >=1.4.1,<=1.9.0
- conda-forge::scikit-image
- conda-forge::scikit-learn ==1.0
- conda-forge::scikit-video
- conda-forge::seaborn
- conda-forge::qudida
- conda-forge::albumentations
- conda-forge::ndx-pose <0.2.0
- conda-forge::importlib-metadata ==4.11.4
run:
- conda-forge::python ==3.7.12 # Run into _MAX_WINDOWS_WORKERS not found if <
- conda-forge::attrs ==21.4.0
- conda-forge::cattrs ==1.1.1
- conda-forge::imageio-ffmpeg # Required for imageio to read/write videos with ffmpeg
- conda-forge::cudatoolkit ==11.3.1
- conda-forge::cudnn=8.2.1
- nvidia::cuda-nvcc=11.3
- conda-forge::pip!=22.0.4

run_constrained:
- pyqt==9999999999
- conda-forge::h5py ==3.7.0
- conda-forge::jsmin
- conda-forge::jsonpickle ==1.2
- conda-forge::networkx
- numpy >=1.19.5,<1.23.0 # Linux likes anaconda, windows likes conda-forge
- conda-forge::opencv <4.9.0
- conda-forge::pandas
- conda-forge::pillow >=8.3.2
- conda-forge::psutil
- conda-forge::pykalman
- conda-forge::pyside2 >=5.12,<5.14 # To ensure works correctly with QtPy.
- conda-forge::python-rapidjson
- conda-forge::pyyaml
- conda-forge::pyzmq
- conda-forge::qtpy >=2.0.1
- conda-forge::rich
- conda-forge::scipy >=1.4.1,<=1.9.0
- conda-forge::scikit-image
- conda-forge::scikit-learn ==1.0
- conda-forge::scikit-video
- conda-forge::seaborn
- sleap/label/dev::tensorflow ==2.7.0 # TODO: Switch to main label when updated
- conda-forge::tensorflow-hub <0.14.0 # Causes pynwb conflicts on linux GH-1446
- conda-forge::qudida
- conda-forge::albumentations
- conda-forge::ndx-pose <0.2.0
- conda-forge::importlib-metadata ==4.11.4

test:
imports:
- sleap
# This no longer works so we have moved it to the build workflow
# https://github.com/talmolab/sleap/pull/1744
# test:
# imports:
# - sleap
6 changes: 6 additions & 0 deletions .conda/sleap_activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# Remember the old library path for when we deactivate
export SLEAP_OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
# Help CUDA find GPUs!
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
4 changes: 4 additions & 0 deletions .conda/sleap_deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# Reset to the old library path for when deactivating the environment
export LD_LIBRARY_PATH=$SLEAP_OLD_LD_LIBRARY_PATH
19 changes: 0 additions & 19 deletions .conda_apple_silicon/README.md

This file was deleted.

Loading

0 comments on commit 5ebf04a

Please sign in to comment.