Skip to content

Commit

Permalink
Merge branch 'develop' into shrivaths/changelog-announcement-1
Browse files Browse the repository at this point in the history
  • Loading branch information
shrivaths16 authored Sep 29, 2023
2 parents c0ea01d + ed77b49 commit 83d34ad
Show file tree
Hide file tree
Showing 25 changed files with 264 additions and 145 deletions.
10 changes: 5 additions & 5 deletions .conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ 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.
export CHANGE=activate

mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
ls "${RECIPE_DIR}"
cp "${RECIPE_DIR}/${PKG_NAME}_${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
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
2 changes: 2 additions & 0 deletions .conda/sleap_activate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Please include information about how you installed.
- OS:
<!-- [e.g. ubuntu 20.04, macOS 11.0] -->
- Version(s):
<!-- e.g. [SLEAP v1.3.2, python 3.8] --->
<!-- e.g. [SLEAP v1.3.3, python 3.8] --->
- SLEAP installation method (listed [here](https://sleap.ai/installation.html#)):
- [ ] [Conda from package](https://sleap.ai/installation.html#conda-package)
- [ ] [Conda from source](https://sleap.ai/installation.html#conda-from-source)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
copyright = f"2019–{date.today().year}, Talmo Lab"

# The short X.Y version
version = "1.3.2"
version = "1.3.3"

# Get the sleap version
# with open("../sleap/version.py") as f:
# version_file = f.read()
# version = re.search("\d.+(?=['\"])", version_file).group(0)

# Release should be the full branch name
release = "v1.3.2"
release = "v1.3.3"

html_title = f"SLEAP ({release})"
html_short_title = "SLEAP"
Expand Down
3 changes: 3 additions & 0 deletions docs/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ optional arguments:
--distinctly_color DISTINCTLY_COLOR
Specify how to color instances. Options include: "instances",
"edges", and "nodes" (default: "instances")
--background BACKGROUND
Specify the type of background to be used to save the videos.
Options: original, black, white and grey. (default: "original")
```

## Debugging
Expand Down
26 changes: 18 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ SLEAP can be installed three different ways: via {ref}`conda package<condapackag
**Windows** and **Linux**

```bash
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.2
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.3
```

**Mac OS X** and **Apple Silicon**

```bash
mamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.3.2
mamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.3.3
```

**This is the recommended installation method**.
Expand Down Expand Up @@ -232,7 +232,7 @@ Although you do not need Mambaforge installed to perform a `pip install`, we rec
3. Finally, we can perform the `pip install`:

```bash
pip install sleap[pypi]==1.3.2
pip install sleap[pypi]==1.3.3
```

This works on **any OS except Apple silicon** and on **Google Colab**.
Expand Down Expand Up @@ -343,18 +343,19 @@ python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU')
````{warning}
TensorFlow 2.7+ is currently failing to detect CUDA Toolkit and CuDNN on some systems (see [Issue thread](https://github.com/tensorflow/tensorflow/issues/52988)).
If you run into issues, try downgrading the TensorFlow 2.6:
If you run into issues, either try downgrading the TensorFlow 2.6:
```bash
pip install tensorflow==2.6.3
```
or follow the note below.
````

````{note}
If you are on Linux, have a NVIDIA GPU, and are having trouble utilizing your GPU:
If you are on Linux, have a NVIDIA GPU, but cannot detect your GPU:
```bash
W tensorflow/stream_executor/platform/default/dso_loader.cc:64 Could not load dynamic
library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object
W tensorflow/stream_executor/platform/default/dso_loader.cc:64 Could not load dynamic
library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object
file: No such file or directory
```
Expand All @@ -368,10 +369,19 @@ and run the commands:
```bash
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo '#!/bin/sh' >> $CONDA_PREFIX/etc/conda/activate.d/sleap_activate.sh
echo 'export SLEAP_OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/sleap_activate.sh
echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/sleap_activate.sh
source $CONDA_PREFIX/etc/conda/activate.d/sleap_activate.sh
```
These commands only need to be run once and will subsequently run automatically upon activating your `sleap` environment.
This will set the environment variable `LD_LIBRARY_PATH` each time the environment is activated. The environment variable will remain set in the current terminal even if we deactivate the environment. Although not strictly necessary, if you would also like the environment variable to be reset to the original value when deactivating the environment, we can run the following commands:
```bash
mkdir -p $CONDA_PREFIX/etc/conda/deactivate.d
echo '#!/bin/sh' >> $CONDA_PREFIX/etc/conda/deactivate.d/sleap_deactivate.sh
echo 'export LD_LIBRARY_PATH=$SLEAP_OLD_LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/deactivate.d/sleap_deactivate.sh
```
These commands only need to be run once and will subsequently run automatically upon [de]activating your `sleap` environment.
````

## Upgrading and uninstalling
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Data_structures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"source": [
"# This should take care of all the dependencies on colab:\n",
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1111\n",
"!pip install -qqq \"sleap[pypi]>=1.3.3\"\n",
"\n",
"# But to do it locally, we'd recommend the conda package (available on Windows + Linux):\n",
"# conda create -n sleap -c sleap -c conda-forge -c nvidia sleap"
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Interactive_and_realtime_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"source": [
"# This should take care of all the dependencies on colab:\n",
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1\n",
"!pip install -qqq \"sleap[pypi]>=1.3.3\"\n",
"\n",
"\n",
"# But to do it locally, we'd recommend the conda package (available on Windows + Linux):\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Interactive_and_resumable_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"source": [
"# This should take care of all the dependencies on colab:\n",
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1\n",
"!pip install -qqq \"sleap[pypi]>=1.3.3\"\n",
"\n",
"\n",
"# But to do it locally, we'd recommend the conda package (available on Windows + Linux):\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Model_evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"source": [
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1\n",
"!pip install -qqq \"sleap[pypi]>=1.3.3\"\n",
"!apt -qq install tree\n",
"!wget -q https://storage.googleapis.com/sleap-data/reference/flies13/td_fast.210505_012601.centered_instance.n%3D1800.zip\n",
"!unzip -qq -o -d \"td_fast.210505_012601.centered_instance.n=1800\" \"td_fast.210505_012601.centered_instance.n=1800.zip\""
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Post_inference_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"source": [
"# This should take care of all the dependencies on colab:\n",
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1\n",
"!pip install -qqq \"sleap[pypi]>=1.3.3\"\n",
"\n",
"# But to do it locally, we'd recommend the conda package (available on Windows + Linux):\n",
"# conda create -n sleap -c sleap -c conda-forge -c nvidia sleap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
],
"source": [
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1"
"!pip install -qqq \"sleap[pypi]>=1.3.3\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"source": [
"!pip uninstall -qqq -y opencv-python opencv-contrib-python\n",
"!pip install -qqq sleap==1.3.1"
"!pip install -qqq \"sleap[pypi]>=1.3.3\""
]
},
{
Expand Down
20 changes: 15 additions & 5 deletions pypi_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,34 @@ jsonpickle==1.2
networkx
numpy>=1.19.5,<1.23.0
opencv-python>=4.2.0,<=4.6.0
# opencv-python-headless>=4.2.0.34,<=4.5.5.62
pandas
pillow>=8.3.1,<=8.4.0
psutil
pykalman==0.9.5
PySide2>=5.13.2,<=5.14.1; platform_machine != 'arm64'
PySide6; sys_platform == 'darwin' and platform_machine == 'arm64'
python-rapidjson
# Otherwise error: Microsoft Visual C++ 14.0 is required.
python-rapidjson <=1.10; sys_platform == 'win32'
python-rapidjson; sys_platform != 'win32'
pyyaml
pyzmq
qtpy>=2.0.1
rich==10.16.1
imageio<=2.15.0
imgaug==0.4.0
scipy>=1.4.1,<=1.9.0
scikit-image
scikit-learn ==1.0.*
scikit-video
seaborn
tensorflow
tensorflow-hub
tensorflow>=2.6.3,<2.9; platform_machine != 'arm64'
tensorflow-hub<=0.14.0
# These dependencies are untested since we do not offer a wheel for apple silicon atm.
tensorflow-macos==2.9.2; sys_platform == 'darwin' and platform_machine == 'arm64'
tensorflow-metal==0.5.0; sys_platform == 'darwin' and platform_machine == 'arm64'

# Dependencies of dependencies
# google-auth 2.23.0 has requirement urllib3<2.0
urllib3<2.0 # Not a 'noticed' runtime-dependency
# tensorboard 2.11.2 has requirement protobuf<4,>=3.9.2
# tensorflow 2.11.0 has requirement protobuf<3.20,>=3.9.2
protobuf<3.20 # Makes GUI work in windows
4 changes: 4 additions & 0 deletions sleap/config/labeled_clip_form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ main:
label: Use GUI Visual Settings (colors, line widths)
type: bool
default: true
- name: background
label: Video Background
type: list
options: original,black,white,grey
- name: open_when_done
label: Open When Done Saving
type: bool
Expand Down
1 change: 1 addition & 0 deletions sleap/config/training_editor_form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ optimization:
label: Batch Size
name: optimization.batch_size
type: int
range: 1,512
- default: 100
help: Maximum number of epochs to train for. Training can be stopped manually or automatically if early stopping is enabled and a plateau is detected.
label: Epochs
Expand Down
2 changes: 2 additions & 0 deletions sleap/gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ def do_action(context: CommandContext, params: dict):
frames=list(params["frames"]),
fps=params["fps"],
color_manager=params["color_manager"],
background=params["background"],
show_edges=params["show edges"],
edge_is_wedge=params["edge_is_wedge"],
marker_size=params["marker size"],
Expand Down Expand Up @@ -1354,6 +1355,7 @@ def ask(context: CommandContext, params: dict) -> bool:
params["fps"] = export_options["fps"]
params["scale"] = export_options["scale"]
params["open_when_done"] = export_options["open_when_done"]
params["background"] = export_options["background"]

params["crop"] = None

Expand Down
1 change: 0 additions & 1 deletion sleap/gui/overlays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def remove_from_scene(self):

except RuntimeError as e: # Internal C++ object (PySide2.QtWidgets.QGraphicsPathItem) already deleted.
logger.debug(e)
pass

# Stop tracking the items after they been removed from the scene
self.items = []
Expand Down
Loading

0 comments on commit 83d34ad

Please sign in to comment.