Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation and labeling docs and no cuda yml #847

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# 'main' triggers updates to 'sleap.ai', 'develop' to 'sleap.ai/develop'
- main
- develop
- david/add-CLI-to-render-videos
- liezl/docs-update
paths:
- "docs/**"
- "README.rst"
Expand Down
22 changes: 19 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,36 @@ conda create -y -n sleap -c sleap -c nvidia -c conda-forge sleap=1.2.4

### `conda` from source

1. First, clone the repository:
1. First, ensure git is installed:

```bash
git --version
```

If 'git' is not recognized, then [install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

2. Then, clone the repository:

```bash
git clone https://github.com/talmolab/sleap && cd sleap
```

2. Then, install from the environment file:
3. Finally, install from the environment file:

```bash
conda env create -f environment.yml -n sleap
```

If you do not have a NVIDIA GPU, then you should use the no CUDA environment file:

```bash
conda env create -f environment_no_cuda.yml -n sleap
```

This works on **Windows**, **Linux** and **Mac OS X** (pre-M1). This is the **recommended method for development**.

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
.. _assisted-labeling:
---
substitutions:
imagefix: |-
```{image} ../_static/fixing-predictions.gif
```
---

Prediction-assisted labeling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(assisted-labeling)=

*Prediction-assisted labeling* has two main goals. First, it speeds up the labeling
# Prediction-assisted labeling

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


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

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

Reviewing and fixing predictions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Reviewing and fixing predictions

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

Predicted instances will *not* be used for future model training unless you
Predicted instances will _not_ be used for future model training unless you
correct the predictions in the GUI.

|imagefix|
{{ imagefix }}

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

:::{note}
All node labels on the regular instance will be colored red.
After moving nodes, the node labels will colored green. This is just a visual indicator
to keep track of which nodes have been moved from the original prediction.
:::

You can now edit the instance as before. Once you’ve added and/or
corrected more instances, you can repeat the process:
train a new model, predict on more frames, correct those predictions,
and so on. You’ll want to regularly generate new frame suggestions,
since active learning will return predictions for just these frames.

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.


Continue to :ref:`proofreading-tutorial`.
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.

.. |imagefix| image:: ../_static/fixing-predictions.gif
Continue to {ref}`proofreading-tutorial`.
16 changes: 9 additions & 7 deletions environment_no_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ name: sleap

dependencies:
- python=3.7
# - conda-forge::numpy>=1.19.5,<=1.21.5
# - sleap::tensorflow>=2.6.3,<=2.7.1
# - conda-forge::pyside2>=5.13.2,<=5.14.1
# - conda-forge::h5py>=3.1.0,<=3.6.0
# - conda-forge::scipy>=1.4.1,<=1.7.3
- conda-forge::numpy>=1.19.5,<=1.21.5
# - conda-forge::tensorflow>=2.6.3,<=2.7.1
- conda-forge::pyside2>=5.13.2,<=5.14.1
- conda-forge::h5py=3.1.0
- conda-forge::scipy>=1.4.1,<=1.7.3
- pillow=8.4.0
- shapely=1.7.1
# - conda-forge::pandas
- conda-forge::pandas
- ffmpeg
# - cudatoolkit=11.3.1
# - cudnn=8.2.1
# - nvidia::cuda-nvcc=11.3
# - sleap::tensorflow=2.7.0
# - sleap::pyside2=5.14.1
- conda-forge::pip<=22.0.3
- pip:
- "."
- "--editable=."
- "--requirement=./dev_requirements.txt"