Skip to content

Commit 18b25b2

Browse files
authored
SLEAP v1.2.5 (#857)
* Add read/write adaptor for ndx-pose (#835) * Change existing skeleton to match skeleton loaded via "Load Skeleton" button (#840) * Update installation and labeling docs and no cuda yml (#847) * Recalculate crop size if user-specified crop size indivisible by max stride (#841) * Expose attributes of NWBFile and create Labels API for exporting to NWB (#855) * SLEAP v1.2.5 (develop) (#856)
1 parent dbc8d53 commit 18b25b2

File tree

22 files changed

+1017
-58
lines changed

22 files changed

+1017
-58
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Please include information about how you installed.
2828
- OS:
2929
<!-- [e.g. ubuntu 20.04, macOS 11.0] -->
3030
- Version(s):
31-
<!-- e.g. [SLEAP v1.2.4, python 3.8] --->
31+
<!-- e.g. [SLEAP v1.2.5, python 3.8] --->
3232
- SLEAP installation method (listed [here](https://sleap.ai/installation.html#)):
3333
- [ ] [Conda from package](https://sleap.ai/installation.html#conda-package)
3434
- [ ] [Conda from source](https://sleap.ai/installation.html#conda-from-source)

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
# 'main' triggers updates to 'sleap.ai', 'develop' to 'sleap.ai/develop'
99
- main
1010
- develop
11-
- david/add-CLI-to-render-videos
11+
- liezl/docs-update
1212
paths:
1313
- "docs/**"
1414
- "README.rst"

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
copyright = f"2019–{date.today().year}, Talmo Lab"
2929

3030
# The short X.Y version
31-
version = "1.2.4"
31+
version = "1.2.5"
3232

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

3838
# Release should be the full branch name
39-
release = "v1.2.4"
39+
release = "v1.2.5"
4040

4141
html_title = f"SLEAP ({release})"
4242
html_short_title = "SLEAP"

docs/installation.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ On Windows, our personal preference is to use alternative terminal apps like [Cm
6464
### `conda` package
6565

6666
```bash
67-
conda create -y -n sleap -c sleap -c nvidia -c conda-forge sleap=1.2.4
67+
conda create -y -n sleap -c sleap -c nvidia -c conda-forge sleap=1.2.5
6868
```
6969

7070
**This is the recommended installation method**. Works on **Windows** and **Linux**.
@@ -77,27 +77,43 @@ conda create -y -n sleap -c sleap -c nvidia -c conda-forge sleap=1.2.4
7777

7878
### `conda` from source
7979

80-
1. First, clone the repository:
80+
1. First, ensure git is installed:
81+
82+
```bash
83+
git --version
84+
```
85+
86+
If 'git' is not recognized, then [install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
87+
88+
2. Then, clone the repository:
8189

8290
```bash
8391
git clone https://github.com/talmolab/sleap && cd sleap
8492
```
8593

86-
2. Then, install from the environment file:
94+
3. Finally, install from the environment file:
95+
8796
```bash
8897
conda env create -f environment.yml -n sleap
8998
```
99+
100+
If you do not have a NVIDIA GPU, then you should use the no CUDA environment file:
101+
102+
```bash
103+
conda env create -f environment_no_cuda.yml -n sleap
104+
```
105+
90106
This works on **Windows**, **Linux** and **Mac OS X** (pre-M1). This is the **recommended method for development**.
91107

92108
```{note}
93-
- This install SLEAP in development mode, which means that edits to the source code will be applied the next time you run SLEAP.
109+
- This installs SLEAP in development mode, which means that edits to the source code will be applied the next time you run SLEAP.
94110
- Change the `-n sleap` in the command to create an environment with a different name (e.g., `-n sleap_develop`).
95111
```
96112

97113
### `pip` package
98114

99115
```bash
100-
pip install sleap==1.2.4
116+
pip install sleap==1.2.5
101117
```
102118

103119
This works on **any OS** and on **Google Colab**.
Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
.. _assisted-labeling:
1+
---
2+
substitutions:
3+
imagefix: |-
4+
```{image} ../_static/fixing-predictions.gif
5+
```
6+
---
27

3-
Prediction-assisted labeling
4-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8+
(assisted-labeling)=
59

6-
*Prediction-assisted labeling* has two main goals. First, it speeds up the labeling
10+
# Prediction-assisted labeling
11+
12+
_Prediction-assisted labeling_ has two main goals. First, it speeds up the labeling
713
process as it is faster to correct a predicted instance which is mostly
814
correct than it is to add a new instance from scratch. Second, it
915
provides feedback about where your model does well and where it does
1016
poorly, and this should give you a better idea of which frames will be
1117
most useful to label.
1218

13-
1419
The GUI doesn’t yet give you a way to monitor the progress during inference,
1520
although it will alert you if an error occurs during inference.
1621

1722
When inference finishes, you’ll be told how many instances were
1823
predicted. Suggested frames with predicted instances will be marked in
1924
red on the seekbar.
2025

21-
Reviewing and fixing predictions
22-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
# Reviewing and fixing predictions
2327

2428
After you’ve successfully trained models and predicted some instances,
2529
you’ll get a message that inference has finished.
@@ -28,24 +32,27 @@ that you manually labeled will be marked with a thicker black line. (For
2832
"suggested" frames, manually labeled frames will have a dark blue line and
2933
predicted frames will have a lighter blue.)
3034

31-
Predicted instances will *not* be used for future model training unless you
35+
Predicted instances will _not_ be used for future model training unless you
3236
correct the predictions in the GUI.
3337

34-
|imagefix|
38+
{{ imagefix }}
3539

3640
Predicted instances in the frame are displayed in grey with yellow
3741
nodes. To edit a prediction, you’ll need to replace it with an editable
3842
instance. **Double-click** the predicted instance and it will be converted into a regular instance.
3943

44+
:::{note}
45+
All node labels on the regular instance will be colored red.
46+
After moving nodes, the node labels will colored green. This is just a visual indicator
47+
to keep track of which nodes have been moved from the original prediction.
48+
:::
49+
4050
You can now edit the instance as before. Once you’ve added and/or
4151
corrected more instances, you can repeat the process:
4252
train a new model, predict on more frames, correct those predictions,
4353
and so on. You’ll want to regularly generate new frame suggestions,
4454
since active learning will return predictions for just these frames.
4555

46-
After you have accurate frame-by-frame prediction, you’re ready to predict for entire video clips and to track animal identities. We use a variety of heuristic algorithms for tracking identities across time (see :ref:`tracking-method-details` for more details). SLEAP also includes a graphical proof-reading tool for quickly assessing the accuracy of tracking and correcting problems.
47-
48-
49-
Continue to :ref:`proofreading-tutorial`.
56+
After you have accurate frame-by-frame prediction, you’re ready to predict for entire video clips and to track animal identities. We use a variety of heuristic algorithms for tracking identities across time (see {ref}`tracking-method-details` for more details). SLEAP also includes a graphical proof-reading tool for quickly assessing the accuracy of tracking and correcting problems.
5057

51-
.. |imagefix| image:: ../_static/fixing-predictions.gif
58+
Continue to {ref}`proofreading-tutorial`.

environment_no_cuda.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ name: sleap
22

33
dependencies:
44
- python=3.7
5-
# - conda-forge::numpy>=1.19.5,<=1.21.5
6-
# - sleap::tensorflow>=2.6.3,<=2.7.1
7-
# - conda-forge::pyside2>=5.13.2,<=5.14.1
8-
# - conda-forge::h5py>=3.1.0,<=3.6.0
9-
# - conda-forge::scipy>=1.4.1,<=1.7.3
5+
- conda-forge::numpy>=1.19.5,<=1.21.5
6+
# - conda-forge::tensorflow>=2.6.3,<=2.7.1
7+
- conda-forge::pyside2>=5.13.2,<=5.14.1
8+
- conda-forge::h5py=3.1.0
9+
- conda-forge::scipy>=1.4.1,<=1.7.3
1010
- pillow=8.4.0
1111
- shapely=1.7.1
12-
# - conda-forge::pandas
12+
- conda-forge::pandas
1313
- ffmpeg
1414
# - cudatoolkit=11.3.1
1515
# - cudnn=8.2.1
1616
# - nvidia::cuda-nvcc=11.3
17+
# - sleap::tensorflow=2.7.0
18+
# - sleap::pyside2=5.14.1
1719
- conda-forge::pip<=22.0.3
1820
- pip:
19-
- "."
21+
- "--editable=."
2022
- "--requirement=./dev_requirements.txt"

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ seaborn
2626
pykalman==0.9.5
2727
segmentation-models==1.0.1
2828
rich==10.16.1
29-
certifi>=2017.4.17,<=2021.10.8
29+
certifi>=2017.4.17,<=2021.10.8
30+
pynwb
31+
ndx-pose

sleap/gui/app.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@ def add_submenu_choices(menu, title, options, key):
400400
"AlphaTracker dataset...",
401401
self.commands.importAT,
402402
)
403+
add_menu_item(
404+
import_types_menu,
405+
"import_nwb",
406+
"NWB dataset...",
407+
self.commands.importNWB,
408+
)
403409
add_menu_item(
404410
import_types_menu,
405411
"import_leap",
@@ -444,6 +450,8 @@ def add_submenu_choices(menu, title, options, key):
444450
lambda: self.commands.exportAnalysisFile(all_videos=True),
445451
)
446452

453+
add_menu_item(fileMenu, "export_nwb", "Export NWB...", self.commands.exportNWB)
454+
447455
fileMenu.addSeparator()
448456
add_menu_item(
449457
fileMenu, "reset prefs", "Reset preferences to defaults...", self.resetPrefs

0 commit comments

Comments
 (0)