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

Supervised Identity Prediction (#460) #679

Merged
merged 8 commits into from
Mar 19, 2022
Merged

Supervised Identity Prediction (#460) #679

merged 8 commits into from
Mar 19, 2022

Conversation

roomrys
Copy link
Collaborator

@roomrys roomrys commented Mar 16, 2022

Description

Implements supervised identity prediction models that predict instance identity.

Supplants the temporal association-based trackers since classification is performed with single images from visual appearance alone. This implements both bottom-up and top-down versions of the classification models.

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (explain)

Does this address any currently open issues?

Supervised identity prediction

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

Full changelog

  • Add test dataset with tracks

  • Add track indices to labels provider

  • Add identity class map generator

  • Update docstring

  • Add class map model trainer, head and config

  • Add inference

  • Docs and tests for identity module

    • Slightly modified matching to greedy-like behavior
  • Fix inference

    • Add imports to evals inference
    • Move the common Predictor.predict() method to base class
    • Fix docstrings for new inference classes
    • Add test model and integration test
  • Generate tracks from config metadata if not provided

  • Force typecasting in identity functions

  • Force boolean masking op

  • Clean up inference module

    • Move common Predictor methods to base class
    • Switch to model.predict_on_batch() for massive performance increase
      with predictor.predict().
    • Enable prediction directly on arrays (slow)
  • Enable Qt5Agg backend only when necessary during training

  • Top-down supervised identity prediction (Top-down supervised identity prediction #476)

  • Add sizematcher to new training pipelines

  • Fix topdown ID visualization during training

  • Add LabeledFrame.tracked_instances property for filtering

    • Greedy checking in has_* properties
  • Add Labels.copy() method for creating deep copies

    • Works by serializing and deserializing to JSON (inefficient, but
      guaranteed to work since we have lots of coverage on I/O)
  • Extract labels with tracked instances

    • Add copy kwarg to extract to return deep copies
    • Remove user and/or untracked instances in with_user_labels_only().
      Previously this functionality was blocked since we couldn't remove the
      instances from labeled frames without affecting the source labels.
    • Add remove_untracked_instances() utility for filtering out instances
      from the labels.
  • Add track filtering in LabelsReader provider

    • This is slightly redundant with
      Labels.with_user_labels_only(..., with_track_only=True) but serves as
      an extra guarantee that we don't train on instances without tracks
      accidentally, regardless of how the data is preprocessed. Can still
      emit "empty" frames if no instances have tracks set, however.
  • Add track filtering in DataReaders during training

    • Auto-enabled when training from ID models
    • Filters out instances without tracks BEFORE train/val splitting
    • Split is now done on copy of labels
    • Fix DataReaders arg typing
    • Tests for DataReaders
  • Add crop size detection to topdown ID models

    • Add training integration test for topdown ID
  • Add removal of untracked instances for labeled instances

    • previously used LabeledFrame.tracked_instances() which only returns predicted instances with tracking
    • created LabeledFrame.remove_untracked which returns both user labeled and predicted instances with tracking
  • Add tests

    • test Labels.remove_untracked_instances() for both cases of remove_empty_frames: bool
    • test LabeledFrames.remove_untracked() for both user-labeled and predicted frames

* Add test dataset with tracks

* Add track indices to labels provider

* Add identity class map generator

* Update docstring

* Add class map model trainer, head and config

* Add inference

* Docs and tests for identity module
- Slightly modified matching to greedy-like behavior
* Fix inference
- Add imports to evals inference
- Move the common Predictor.predict() method to base class
- Fix docstrings for new inference classes
- Add test model and integration test

* Generate tracks from config metadata if not provided

* Force typecasting in identity functions

* Force boolean masking op

* Clean up inference module
- Move common Predictor methods to base class
- Switch to `model.predict_on_batch()` for massive performance increase
  with `predictor.predict()`.
- Enable prediction directly on arrays (slow)

* Enable Qt5Agg backend only when necessary during training

* Top-down supervised identity prediction (#476)

* Add sizematcher to new training pipelines

* Fix topdown ID visualization during training

* Add LabeledFrame.tracked_instances property for filtering
- Greedy checking in has_* properties

* Add Labels.copy() method for creating deep copies
- Works by serializing and deserializing to JSON (inefficient, but
  guaranteed to work since we have lots of coverage on I/O)

* Extract labels with tracked instances
- Add copy kwarg to extract to return deep copies
- Remove user and/or untracked instances in with_user_labels_only().
  Previously this functionality was blocked since we couldn't remove the
  instances from labeled frames without affecting the source labels.
- Add remove_untracked_instances() utility for filtering out instances
  from the labels.

* Add track filtering in LabelsReader provider
- This is slightly redundant with
  Labels.with_user_labels_only(..., with_track_only=True) but serves as
  an extra guarantee that we don't train on instances without tracks
  accidentally, regardless of how the data is preprocessed. Can still
  emit "empty" frames if no instances have tracks set, however.

* Add track filtering in DataReaders during training
- Auto-enabled when training from ID models
- Filters out instances without tracks BEFORE train/val splitting
- Split is now done on copy of labels
- Fix DataReaders arg typing
- Tests for DataReaders

* Add crop size detection to topdown ID models
- Add training integration test for topdown ID
* Add removal of untracked instances for labeled instances
- previously used `LabeledFrame.tracked_instances()` which only returns predicted instances with tracking
- created `LabeledFrame.remove_untracked` which returns both user labeled and predicted instances with tracking
* Formatting
- using black v20.8b1
@codecov
Copy link

codecov bot commented Mar 17, 2022

Codecov Report

Merging #679 (6be61d0) into develop (1c57287) will increase coverage by 0.50%.
The diff coverage is 75.82%.

@@             Coverage Diff             @@
##           develop     #679      +/-   ##
===========================================
+ Coverage    64.89%   65.40%   +0.50%     
===========================================
  Files          124      126       +2     
  Lines        20202    21002     +800     
===========================================
+ Hits         13111    13737     +626     
- Misses        7091     7265     +174     
Impacted Files Coverage Δ
sleap/nn/config/__init__.py 100.00% <ø> (ø)
sleap/nn/evals.py 13.04% <0.00%> (-0.24%) ⬇️
sleap/nn/data/instance_cropping.py 65.69% <50.00%> (-0.48%) ⬇️
sleap/nn/data/providers.py 64.88% <60.00%> (+1.89%) ⬆️
sleap/nn/training.py 60.02% <65.00%> (+0.68%) ⬆️
sleap/nn/inference.py 65.01% <65.56%> (+1.67%) ⬆️
sleap/nn/identity.py 80.00% <80.00%> (ø)
sleap/nn/data/identity.py 83.92% <83.92%> (ø)
sleap/nn/model.py 91.66% <84.78%> (-3.39%) ⬇️
sleap/nn/data/pipelines.py 89.56% <90.72%> (+0.37%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c57287...6be61d0. Read the comment docs.

* Add tests
- test `Labels.remove_untracked_instances()` for both cases of `remove_empty_frames: bool`
-test `LabeledFrames.remove_untracked()` for both user-labeled and predicted frames
@roomrys roomrys changed the title squash merge from roomrys/sleap-1 (#460) Supervised Identity Prediction (#460) Mar 18, 2022
* add newline (no indent) at end of files which had failed Lint test
@roomrys roomrys marked this pull request as ready for review March 18, 2022 20:41
@roomrys roomrys merged commit a2738ec into develop Mar 19, 2022
@roomrys roomrys deleted the liezl/supervised_id branch March 19, 2022 01:49
talmo added a commit that referenced this pull request Mar 21, 2022
* Add support for new maDLC labels format (#678)
* Supervised Identity Prediction (#460) (#679)
* Enable TensorFlow 2.8 support (#683)
* Bump minor version (#684)

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>
@roomrys
Copy link
Collaborator Author

roomrys commented Mar 23, 2022

Need to add import sleap.nn.identity to sleap/nn/__init__.py.

Upon running pytest tests in main sleap directory, currently get following error (which is resolved when add change mentioned above):

E                 AttributeError: Exception encountered when calling layer "top_down_multi_class_find_peaks" (type TopDownMultiClassFindPeaks).
E
E                 in user code:
E
E                     File "D:\social-leap-estimates-animal-poses\random\sleap2\sleap\sleap\nn\inference.py", line 3373, in call  *
E                         points, point_vals, class_probs = sleap.nn.identity.classify_peaks_from_vectors(
E
E                     AttributeError: module 'sleap.nn' has no attribute 'identity'

talmo added a commit that referenced this pull request Apr 4, 2022
* Add support for new maDLC labels format (#678)

* Supervised Identity Prediction (#460) (#679)

* squash merge from roomrys/sleap-1 (#460)

* Add test dataset with tracks

* Add track indices to labels provider

* Add identity class map generator

* Update docstring

* Add class map model trainer, head and config

* Add inference

* Docs and tests for identity module
- Slightly modified matching to greedy-like behavior
* Fix inference
- Add imports to evals inference
- Move the common Predictor.predict() method to base class
- Fix docstrings for new inference classes
- Add test model and integration test

* Generate tracks from config metadata if not provided

* Force typecasting in identity functions

* Force boolean masking op

* Clean up inference module
- Move common Predictor methods to base class
- Switch to `model.predict_on_batch()` for massive performance increase
  with `predictor.predict()`.
- Enable prediction directly on arrays (slow)

* Enable Qt5Agg backend only when necessary during training

* Top-down supervised identity prediction (#476)

* Add sizematcher to new training pipelines

* Fix topdown ID visualization during training

* Add LabeledFrame.tracked_instances property for filtering
- Greedy checking in has_* properties

* Add Labels.copy() method for creating deep copies
- Works by serializing and deserializing to JSON (inefficient, but
  guaranteed to work since we have lots of coverage on I/O)

* Extract labels with tracked instances
- Add copy kwarg to extract to return deep copies
- Remove user and/or untracked instances in with_user_labels_only().
  Previously this functionality was blocked since we couldn't remove the
  instances from labeled frames without affecting the source labels.
- Add remove_untracked_instances() utility for filtering out instances
  from the labels.

* Add track filtering in LabelsReader provider
- This is slightly redundant with
  Labels.with_user_labels_only(..., with_track_only=True) but serves as
  an extra guarantee that we don't train on instances without tracks
  accidentally, regardless of how the data is preprocessed. Can still
  emit "empty" frames if no instances have tracks set, however.

* Add track filtering in DataReaders during training
- Auto-enabled when training from ID models
- Filters out instances without tracks BEFORE train/val splitting
- Split is now done on copy of labels
- Fix DataReaders arg typing
- Tests for DataReaders

* Add crop size detection to topdown ID models
- Add training integration test for topdown ID

* add removal of untracked instances for labeled instances (#460)

* Add removal of untracked instances for labeled instances
- previously used `LabeledFrame.tracked_instances()` which only returns predicted instances with tracking
- created `LabeledFrame.remove_untracked` which returns both user labeled and predicted instances with tracking
* Formatting
- using black v20.8b1

* add tests for Labels and LabeledFrames (#460)

* Add tests
- test `Labels.remove_untracked_instances()` for both cases of `remove_empty_frames: bool`
-test `LabeledFrames.remove_untracked()` for both user-labeled and predicted frames

* formatting (#460)

* add newline (no indent) at end of files which had failed Lint test

* clean-up comments and unneeded parenthesis (#460)

* Last merge fixes

* Lint

* Bump minor version (#684)

* Fix numpy conversion in inference (#687)

* Expose identity module in nn

* Override predict_on_batch to optionally cast data to numpy

* Fix topological sorting to always start with root node (#688)

* Fix topological sorting to always start with root node

* Add test

* Create unique default shortcuts (#686) (#690)

* Training monitor enhancements (#691)

* Training monitor enhancements
- Cleaned up imports
- Docstrings
- Now update based on time, not epochs
- Added markers for epoch-level losses
- Added best validation loss marker and text
- Reduced minimum possible y-axis value when log scaling
- Marker colors, alpha, sizes and line widths adjusted

* Move training monitor to gui submodule

* add metrics to training monitor title

* add mean time per epoch
* add ETA to finish next 10 epochs
* add plateau patience fraction (when in plateau)
* update dev_requirements to install version of click that does not break black

* Add code coverage

* add coverage for all lines within LossViewer.update_runtime()

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>

* add hide instance menu item and hotkey (#692)

* Single press of hotkey (H) toggles instance visibility

* Add instance visibility message/warning to status bar

* Resize keyboard shortcuts dialog box

* Fix formatting to read and save tracking scores (#693)

* Update formatting to include tracking_scores

* Add formatting fixtures, tracking_scores test

* Hide predicted instances with hotkey (#694)

* add hide instance menu item and hotkey

* single press of hotkey (H) toggles instance visibility

* Add instance visibility message to status bar

* Resize keyboard shortcuts dialog box

* Make shortcuts pop-up slightly narrower and taller

* Hide predicted instances as well

* hide predicted instances
* update status bar message:
- count only visible predicted and labeled instances
- only show "hidden instances" warning when number instances in frame is greater than 0
- normal font weight

* Logic update for detecting instances to show

* Add test for instance visibility

* Change which qtbot wait is used

* Change timeout of qtbot.waitActive

- attempt to pass ubuntu tests on github actions

* Use arbitrary qtbot.wait

Hope to verify that ubuntu test fails due to a waiting error

* Add test for instance colors

- predict ubuntu test will fail

* Add test skip mark for ubuntu

* Import pytest

* Skip test for linux

* Remove unused packages

* Talmo/pre v1.2.2 (#696)

* Change default tab appearance

* Bump to 1.2.2

* Add more notebooks to docs (#698)

* Fix missing links and update content

* Add new notebooks

* Add troubleshooting guide

* Datasets and paper link update

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>
Co-authored-by: sheridana <asheridan@salk.edu>
talmo added a commit that referenced this pull request May 10, 2022
* Add support for new maDLC labels format (#678)

* Supervised Identity Prediction (#460) (#679)

* squash merge from roomrys/sleap-1 (#460)

* Add test dataset with tracks

* Add track indices to labels provider

* Add identity class map generator

* Update docstring

* Add class map model trainer, head and config

* Add inference

* Docs and tests for identity module
- Slightly modified matching to greedy-like behavior
* Fix inference
- Add imports to evals inference
- Move the common Predictor.predict() method to base class
- Fix docstrings for new inference classes
- Add test model and integration test

* Generate tracks from config metadata if not provided

* Force typecasting in identity functions

* Force boolean masking op

* Clean up inference module
- Move common Predictor methods to base class
- Switch to `model.predict_on_batch()` for massive performance increase
  with `predictor.predict()`.
- Enable prediction directly on arrays (slow)

* Enable Qt5Agg backend only when necessary during training

* Top-down supervised identity prediction (#476)

* Add sizematcher to new training pipelines

* Fix topdown ID visualization during training

* Add LabeledFrame.tracked_instances property for filtering
- Greedy checking in has_* properties

* Add Labels.copy() method for creating deep copies
- Works by serializing and deserializing to JSON (inefficient, but
  guaranteed to work since we have lots of coverage on I/O)

* Extract labels with tracked instances
- Add copy kwarg to extract to return deep copies
- Remove user and/or untracked instances in with_user_labels_only().
  Previously this functionality was blocked since we couldn't remove the
  instances from labeled frames without affecting the source labels.
- Add remove_untracked_instances() utility for filtering out instances
  from the labels.

* Add track filtering in LabelsReader provider
- This is slightly redundant with
  Labels.with_user_labels_only(..., with_track_only=True) but serves as
  an extra guarantee that we don't train on instances without tracks
  accidentally, regardless of how the data is preprocessed. Can still
  emit "empty" frames if no instances have tracks set, however.

* Add track filtering in DataReaders during training
- Auto-enabled when training from ID models
- Filters out instances without tracks BEFORE train/val splitting
- Split is now done on copy of labels
- Fix DataReaders arg typing
- Tests for DataReaders

* Add crop size detection to topdown ID models
- Add training integration test for topdown ID

* add removal of untracked instances for labeled instances (#460)

* Add removal of untracked instances for labeled instances
- previously used `LabeledFrame.tracked_instances()` which only returns predicted instances with tracking
- created `LabeledFrame.remove_untracked` which returns both user labeled and predicted instances with tracking
* Formatting
- using black v20.8b1

* add tests for Labels and LabeledFrames (#460)

* Add tests
- test `Labels.remove_untracked_instances()` for both cases of `remove_empty_frames: bool`
-test `LabeledFrames.remove_untracked()` for both user-labeled and predicted frames

* formatting (#460)

* add newline (no indent) at end of files which had failed Lint test

* clean-up comments and unneeded parenthesis (#460)

* Last merge fixes

* Lint

* Bump minor version (#684)

* Fix numpy conversion in inference (#687)

* Expose identity module in nn

* Override predict_on_batch to optionally cast data to numpy

* Fix topological sorting to always start with root node (#688)

* Fix topological sorting to always start with root node

* Add test

* Create unique default shortcuts (#686) (#690)

* Training monitor enhancements (#691)

* Training monitor enhancements
- Cleaned up imports
- Docstrings
- Now update based on time, not epochs
- Added markers for epoch-level losses
- Added best validation loss marker and text
- Reduced minimum possible y-axis value when log scaling
- Marker colors, alpha, sizes and line widths adjusted

* Move training monitor to gui submodule

* add metrics to training monitor title

* add mean time per epoch
* add ETA to finish next 10 epochs
* add plateau patience fraction (when in plateau)
* update dev_requirements to install version of click that does not break black

* Add code coverage

* add coverage for all lines within LossViewer.update_runtime()

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>

* add hide instance menu item and hotkey (#692)

* Single press of hotkey (H) toggles instance visibility

* Add instance visibility message/warning to status bar

* Resize keyboard shortcuts dialog box

* Fix formatting to read and save tracking scores (#693)

* Update formatting to include tracking_scores

* Add formatting fixtures, tracking_scores test

* Hide predicted instances with hotkey (#694)

* add hide instance menu item and hotkey

* single press of hotkey (H) toggles instance visibility

* Add instance visibility message to status bar

* Resize keyboard shortcuts dialog box

* Make shortcuts pop-up slightly narrower and taller

* Hide predicted instances as well

* hide predicted instances
* update status bar message:
- count only visible predicted and labeled instances
- only show "hidden instances" warning when number instances in frame is greater than 0
- normal font weight

* Logic update for detecting instances to show

* Add test for instance visibility

* Change which qtbot wait is used

* Change timeout of qtbot.waitActive

- attempt to pass ubuntu tests on github actions

* Use arbitrary qtbot.wait

Hope to verify that ubuntu test fails due to a waiting error

* Add test for instance colors

- predict ubuntu test will fail

* Add test skip mark for ubuntu

* Import pytest

* Skip test for linux

* Remove unused packages

* Talmo/pre v1.2.2 (#696)

* Change default tab appearance

* Bump to 1.2.2

* Add more notebooks to docs (#698)

* Fix missing links and update content

* Add new notebooks

* Add troubleshooting guide

* Datasets and paper link update

* Add support for new single animal DLC format (#704)

* Add support for single animal DLC files (#702)

* Add test for new format single animal DLC

* Add test images for visual verification

* Add data and test for old version single animal DLC file

* Add edges to analysis h5 (#707)

* Add edge names and edge indices to analysis h5

* Add test for node names and edge names in analysis h5 export

* Speed-up labeling suggestions look-up (#709)

* Use data cache to speed-up labeling suggestions

* Move logic from Labels.__getitem__ to Labels.get

* Use Labels.__getitem__ as a wrapper to Labels.get

* Add support for AlphaTracker import (#716)

* Add support for AlphaTrackor import

* Integrate adaptor into sleap

* Add tests

* Specify pip version in environment_no_cuda.yml

* Specify pip version in environment.yml

* Remove pip version from environment_no_cuda.yml

* Specify channel and version for pip in environment_no_cuda

* Add GUI-based test

* Add property tests and lint

* Delete condaenv.25edtblj.requirements.txt

Co-authored-by: Talmo Pereira <talmo@salk.edu>

* Update links from murthylab to talmolab (#724)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* SLEAP v1.2.3 (#726)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* Update pip in all environments

* Update to v1.2.3

* Fix typo on the datasets

Co-authored-by: sheridana <asheridan@salk.edu>

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>
Co-authored-by: sheridana <asheridan@salk.edu>
talmo added a commit that referenced this pull request Jul 26, 2022
* Add support for new maDLC labels format (#678)

* Supervised Identity Prediction (#460) (#679)

* squash merge from roomrys/sleap-1 (#460)

* Add test dataset with tracks

* Add track indices to labels provider

* Add identity class map generator

* Update docstring

* Add class map model trainer, head and config

* Add inference

* Docs and tests for identity module
- Slightly modified matching to greedy-like behavior
* Fix inference
- Add imports to evals inference
- Move the common Predictor.predict() method to base class
- Fix docstrings for new inference classes
- Add test model and integration test

* Generate tracks from config metadata if not provided

* Force typecasting in identity functions

* Force boolean masking op

* Clean up inference module
- Move common Predictor methods to base class
- Switch to `model.predict_on_batch()` for massive performance increase
  with `predictor.predict()`.
- Enable prediction directly on arrays (slow)

* Enable Qt5Agg backend only when necessary during training

* Top-down supervised identity prediction (#476)

* Add sizematcher to new training pipelines

* Fix topdown ID visualization during training

* Add LabeledFrame.tracked_instances property for filtering
- Greedy checking in has_* properties

* Add Labels.copy() method for creating deep copies
- Works by serializing and deserializing to JSON (inefficient, but
  guaranteed to work since we have lots of coverage on I/O)

* Extract labels with tracked instances
- Add copy kwarg to extract to return deep copies
- Remove user and/or untracked instances in with_user_labels_only().
  Previously this functionality was blocked since we couldn't remove the
  instances from labeled frames without affecting the source labels.
- Add remove_untracked_instances() utility for filtering out instances
  from the labels.

* Add track filtering in LabelsReader provider
- This is slightly redundant with
  Labels.with_user_labels_only(..., with_track_only=True) but serves as
  an extra guarantee that we don't train on instances without tracks
  accidentally, regardless of how the data is preprocessed. Can still
  emit "empty" frames if no instances have tracks set, however.

* Add track filtering in DataReaders during training
- Auto-enabled when training from ID models
- Filters out instances without tracks BEFORE train/val splitting
- Split is now done on copy of labels
- Fix DataReaders arg typing
- Tests for DataReaders

* Add crop size detection to topdown ID models
- Add training integration test for topdown ID

* add removal of untracked instances for labeled instances (#460)

* Add removal of untracked instances for labeled instances
- previously used `LabeledFrame.tracked_instances()` which only returns predicted instances with tracking
- created `LabeledFrame.remove_untracked` which returns both user labeled and predicted instances with tracking
* Formatting
- using black v20.8b1

* add tests for Labels and LabeledFrames (#460)

* Add tests
- test `Labels.remove_untracked_instances()` for both cases of `remove_empty_frames: bool`
-test `LabeledFrames.remove_untracked()` for both user-labeled and predicted frames

* formatting (#460)

* add newline (no indent) at end of files which had failed Lint test

* clean-up comments and unneeded parenthesis (#460)

* Last merge fixes

* Lint

* Bump minor version (#684)

* Fix numpy conversion in inference (#687)

* Expose identity module in nn

* Override predict_on_batch to optionally cast data to numpy

* Fix topological sorting to always start with root node (#688)

* Fix topological sorting to always start with root node

* Add test

* Create unique default shortcuts (#686) (#690)

* Training monitor enhancements (#691)

* Training monitor enhancements
- Cleaned up imports
- Docstrings
- Now update based on time, not epochs
- Added markers for epoch-level losses
- Added best validation loss marker and text
- Reduced minimum possible y-axis value when log scaling
- Marker colors, alpha, sizes and line widths adjusted

* Move training monitor to gui submodule

* add metrics to training monitor title

* add mean time per epoch
* add ETA to finish next 10 epochs
* add plateau patience fraction (when in plateau)
* update dev_requirements to install version of click that does not break black

* Add code coverage

* add coverage for all lines within LossViewer.update_runtime()

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>

* add hide instance menu item and hotkey (#692)

* Single press of hotkey (H) toggles instance visibility

* Add instance visibility message/warning to status bar

* Resize keyboard shortcuts dialog box

* Fix formatting to read and save tracking scores (#693)

* Update formatting to include tracking_scores

* Add formatting fixtures, tracking_scores test

* Hide predicted instances with hotkey (#694)

* add hide instance menu item and hotkey

* single press of hotkey (H) toggles instance visibility

* Add instance visibility message to status bar

* Resize keyboard shortcuts dialog box

* Make shortcuts pop-up slightly narrower and taller

* Hide predicted instances as well

* hide predicted instances
* update status bar message:
- count only visible predicted and labeled instances
- only show "hidden instances" warning when number instances in frame is greater than 0
- normal font weight

* Logic update for detecting instances to show

* Add test for instance visibility

* Change which qtbot wait is used

* Change timeout of qtbot.waitActive

- attempt to pass ubuntu tests on github actions

* Use arbitrary qtbot.wait

Hope to verify that ubuntu test fails due to a waiting error

* Add test for instance colors

- predict ubuntu test will fail

* Add test skip mark for ubuntu

* Import pytest

* Skip test for linux

* Remove unused packages

* Talmo/pre v1.2.2 (#696)

* Change default tab appearance

* Bump to 1.2.2

* Add more notebooks to docs (#698)

* Fix missing links and update content

* Add new notebooks

* Add troubleshooting guide

* Datasets and paper link update

* Add support for new single animal DLC format (#704)

* Add support for single animal DLC files (#702)

* Add test for new format single animal DLC

* Add test images for visual verification

* Add data and test for old version single animal DLC file

* Add edges to analysis h5 (#707)

* Add edge names and edge indices to analysis h5

* Add test for node names and edge names in analysis h5 export

* Speed-up labeling suggestions look-up (#709)

* Use data cache to speed-up labeling suggestions

* Move logic from Labels.__getitem__ to Labels.get

* Use Labels.__getitem__ as a wrapper to Labels.get

* Add support for AlphaTracker import (#716)

* Add support for AlphaTrackor import

* Integrate adaptor into sleap

* Add tests

* Specify pip version in environment_no_cuda.yml

* Specify pip version in environment.yml

* Remove pip version from environment_no_cuda.yml

* Specify channel and version for pip in environment_no_cuda

* Add GUI-based test

* Add property tests and lint

* Delete condaenv.25edtblj.requirements.txt

Co-authored-by: Talmo Pereira <talmo@salk.edu>

* Update links from murthylab to talmolab (#724)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* SLEAP v1.2.3 (#726)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* Update pip in all environments

* Update to v1.2.3

* Fix typo on the datasets

Co-authored-by: sheridana <asheridan@salk.edu>

* Test CI

* Fix Imports in test_format.py (#732)

Co-authored-by: Talmo Pereira <talmo@salk.edu>

* Add links to discussion (#748)

* Update codecov badge token

* Add option to predict on all videos (#749)

* Contributing Guide, Code of Conduct, and Issues Template (#746)

* Add contributing draft

* Add code of conduct

* Add issues template

* Update bug_report.md

* Create codecov.yml

Split coverage into gui and non-gui counterpart

* Update codecov.yml

* Update codecov.yml

* Create multiple analysis files for multi-video projects (#768)

* Create occupancy matrix (h5) for single video at a time

* Write additional project metadata to the analysis file (for verification purposes)

* Add GUI option to export analysis of all videos

* Change `sleap-convert` to output one analysis file per video in project

* Use default filename for analysis files if multiple videos

Co-authored-by: Talmo Pereira <talmo@princeton.edu>

* Update tracking docs (#761)

* Convert gui and proofreading rst files to md
* Add section in proofreading for culling target instances
* Add propagate track labels docs to gui and proofreading

Co-authored-by: Arlo Sheridan <38435167+sheridana@users.noreply.github.com>

* Generate suggestions for videos with less frames than samples per video (#781)

* Add support for videos that have fewer frames than the Sample Stride length.

* Add support for videos that have less frames than the desired (random) Samples per Video (#783)

Allow suggestions to be generated randomly for all videos regardless of number of frames.

* Add button to toggle grayscale

* Revert "Add button to toggle grayscale"

This reverts commit 5d71030.

* Add button to toggle grayscale of current video (#788)

* Analysis HDF5 should prefer user-labeled instance over predicted instance (#772)

* Prefer same frame/track user-instances over predicted-instances when writing analysis hdf5

* Choose video to generate suggestions (#786)

Add option for users to select a certain video or all videos to generate suggestion(s) for.

* Add CLI sleap-render command to render videos (#796)

Sleap-render added to CLI & Updated docs

* Allow user to set grayscale when replacing videos (mp4/avi only)  (#787)

* Support grayscale for SingleImageVideo backend (#789)

* Fix h5py dependency (#815)

* Remove low-scoring predictions before merging inference results (#817)

* SLEAP v1.2.4

* SLEAP v1.2.4

No version left behind

* Remove cli.rst (back from the dead)

* Add read/write adaptor for ndx-pose (#835)

- Reads/writes predicted instances to NWB file.

* Change existing skeleton to match skeleton loaded via "Load Skeleton" button (#840)

* Fix Save As bug (#845)

* 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)

Update to SLEAP v1.2.5

* Fix NWB conda packaging (#860)

* Add pynwb and ndx-pose to conda packages

* Bump to v1.2.6

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>
Co-authored-by: sheridana <asheridan@salk.edu>
Co-authored-by: Arlo Sheridan <38435167+sheridana@users.noreply.github.com>
Co-authored-by: David Samy <96505813+davidasamy@users.noreply.github.com>
talmo added a commit that referenced this pull request Jul 26, 2022
SLEAP v1.2.6 (#862)

* Add support for new maDLC labels format (#678)

* Supervised Identity Prediction (#460) (#679)

* squash merge from roomrys/sleap-1 (#460)

* Add test dataset with tracks

* Add track indices to labels provider

* Add identity class map generator

* Update docstring

* Add class map model trainer, head and config

* Add inference

* Docs and tests for identity module
- Slightly modified matching to greedy-like behavior
* Fix inference
- Add imports to evals inference
- Move the common Predictor.predict() method to base class
- Fix docstrings for new inference classes
- Add test model and integration test

* Generate tracks from config metadata if not provided

* Force typecasting in identity functions

* Force boolean masking op

* Clean up inference module
- Move common Predictor methods to base class
- Switch to `model.predict_on_batch()` for massive performance increase
  with `predictor.predict()`.
- Enable prediction directly on arrays (slow)

* Enable Qt5Agg backend only when necessary during training

* Top-down supervised identity prediction (#476)

* Add sizematcher to new training pipelines

* Fix topdown ID visualization during training

* Add LabeledFrame.tracked_instances property for filtering
- Greedy checking in has_* properties

* Add Labels.copy() method for creating deep copies
- Works by serializing and deserializing to JSON (inefficient, but
  guaranteed to work since we have lots of coverage on I/O)

* Extract labels with tracked instances
- Add copy kwarg to extract to return deep copies
- Remove user and/or untracked instances in with_user_labels_only().
  Previously this functionality was blocked since we couldn't remove the
  instances from labeled frames without affecting the source labels.
- Add remove_untracked_instances() utility for filtering out instances
  from the labels.

* Add track filtering in LabelsReader provider
- This is slightly redundant with
  Labels.with_user_labels_only(..., with_track_only=True) but serves as
  an extra guarantee that we don't train on instances without tracks
  accidentally, regardless of how the data is preprocessed. Can still
  emit "empty" frames if no instances have tracks set, however.

* Add track filtering in DataReaders during training
- Auto-enabled when training from ID models
- Filters out instances without tracks BEFORE train/val splitting
- Split is now done on copy of labels
- Fix DataReaders arg typing
- Tests for DataReaders

* Add crop size detection to topdown ID models
- Add training integration test for topdown ID

* add removal of untracked instances for labeled instances (#460)

* Add removal of untracked instances for labeled instances
- previously used `LabeledFrame.tracked_instances()` which only returns predicted instances with tracking
- created `LabeledFrame.remove_untracked` which returns both user labeled and predicted instances with tracking
* Formatting
- using black v20.8b1

* add tests for Labels and LabeledFrames (#460)

* Add tests
- test `Labels.remove_untracked_instances()` for both cases of `remove_empty_frames: bool`
-test `LabeledFrames.remove_untracked()` for both user-labeled and predicted frames

* formatting (#460)

* add newline (no indent) at end of files which had failed Lint test

* clean-up comments and unneeded parenthesis (#460)

* Last merge fixes

* Lint

* Bump minor version (#684)

* Fix numpy conversion in inference (#687)

* Expose identity module in nn

* Override predict_on_batch to optionally cast data to numpy

* Fix topological sorting to always start with root node (#688)

* Fix topological sorting to always start with root node

* Add test

* Create unique default shortcuts (#686) (#690)

* Training monitor enhancements (#691)

* Training monitor enhancements
- Cleaned up imports
- Docstrings
- Now update based on time, not epochs
- Added markers for epoch-level losses
- Added best validation loss marker and text
- Reduced minimum possible y-axis value when log scaling
- Marker colors, alpha, sizes and line widths adjusted

* Move training monitor to gui submodule

* add metrics to training monitor title

* add mean time per epoch
* add ETA to finish next 10 epochs
* add plateau patience fraction (when in plateau)
* update dev_requirements to install version of click that does not break black

* Add code coverage

* add coverage for all lines within LossViewer.update_runtime()

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>

* add hide instance menu item and hotkey (#692)

* Single press of hotkey (H) toggles instance visibility

* Add instance visibility message/warning to status bar

* Resize keyboard shortcuts dialog box

* Fix formatting to read and save tracking scores (#693)

* Update formatting to include tracking_scores

* Add formatting fixtures, tracking_scores test

* Hide predicted instances with hotkey (#694)

* add hide instance menu item and hotkey

* single press of hotkey (H) toggles instance visibility

* Add instance visibility message to status bar

* Resize keyboard shortcuts dialog box

* Make shortcuts pop-up slightly narrower and taller

* Hide predicted instances as well

* hide predicted instances
* update status bar message:
- count only visible predicted and labeled instances
- only show "hidden instances" warning when number instances in frame is greater than 0
- normal font weight

* Logic update for detecting instances to show

* Add test for instance visibility

* Change which qtbot wait is used

* Change timeout of qtbot.waitActive

- attempt to pass ubuntu tests on github actions

* Use arbitrary qtbot.wait

Hope to verify that ubuntu test fails due to a waiting error

* Add test for instance colors

- predict ubuntu test will fail

* Add test skip mark for ubuntu

* Import pytest

* Skip test for linux

* Remove unused packages

* Talmo/pre v1.2.2 (#696)

* Change default tab appearance

* Bump to 1.2.2

* Add more notebooks to docs (#698)

* Fix missing links and update content

* Add new notebooks

* Add troubleshooting guide

* Datasets and paper link update

* Add support for new single animal DLC format (#704)

* Add support for single animal DLC files (#702)

* Add test for new format single animal DLC

* Add test images for visual verification

* Add data and test for old version single animal DLC file

* Add edges to analysis h5 (#707)

* Add edge names and edge indices to analysis h5

* Add test for node names and edge names in analysis h5 export

* Speed-up labeling suggestions look-up (#709)

* Use data cache to speed-up labeling suggestions

* Move logic from Labels.__getitem__ to Labels.get

* Use Labels.__getitem__ as a wrapper to Labels.get

* Add support for AlphaTracker import (#716)

* Add support for AlphaTrackor import

* Integrate adaptor into sleap

* Add tests

* Specify pip version in environment_no_cuda.yml

* Specify pip version in environment.yml

* Remove pip version from environment_no_cuda.yml

* Specify channel and version for pip in environment_no_cuda

* Add GUI-based test

* Add property tests and lint

* Delete condaenv.25edtblj.requirements.txt

Co-authored-by: Talmo Pereira <talmo@salk.edu>

* Update links from murthylab to talmolab (#724)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* SLEAP v1.2.3 (#726)

* Update links from murthylab to talmolab

* Add conda channel for pip install in no cuda yml

* Add try/except for release checker

* Update rest API link

* Update pip in all environments

* Update to v1.2.3

* Fix typo on the datasets

Co-authored-by: sheridana <asheridan@salk.edu>

* Test CI

* Fix Imports in test_format.py (#732)

Co-authored-by: Talmo Pereira <talmo@salk.edu>

* Add links to discussion (#748)

* Update codecov badge token

* Add option to predict on all videos (#749)

* Contributing Guide, Code of Conduct, and Issues Template (#746)

* Add contributing draft

* Add code of conduct

* Add issues template

* Update bug_report.md

* Create codecov.yml

Split coverage into gui and non-gui counterpart

* Update codecov.yml

* Update codecov.yml

* Create multiple analysis files for multi-video projects (#768)

* Create occupancy matrix (h5) for single video at a time

* Write additional project metadata to the analysis file (for verification purposes)

* Add GUI option to export analysis of all videos

* Change `sleap-convert` to output one analysis file per video in project

* Use default filename for analysis files if multiple videos

Co-authored-by: Talmo Pereira <talmo@princeton.edu>

* Update tracking docs (#761)

* Convert gui and proofreading rst files to md
* Add section in proofreading for culling target instances
* Add propagate track labels docs to gui and proofreading

Co-authored-by: Arlo Sheridan <38435167+sheridana@users.noreply.github.com>

* Generate suggestions for videos with less frames than samples per video (#781)

* Add support for videos that have fewer frames than the Sample Stride length.

* Add support for videos that have less frames than the desired (random) Samples per Video (#783)

Allow suggestions to be generated randomly for all videos regardless of number of frames.

* Add button to toggle grayscale

* Revert "Add button to toggle grayscale"

This reverts commit 5d71030.

* Add button to toggle grayscale of current video (#788)

* Analysis HDF5 should prefer user-labeled instance over predicted instance (#772)

* Prefer same frame/track user-instances over predicted-instances when writing analysis hdf5

* Choose video to generate suggestions (#786)

Add option for users to select a certain video or all videos to generate suggestion(s) for.

* Add CLI sleap-render command to render videos (#796)

Sleap-render added to CLI & Updated docs

* Allow user to set grayscale when replacing videos (mp4/avi only)  (#787)

* Support grayscale for SingleImageVideo backend (#789)

* Fix h5py dependency (#815)

* Remove low-scoring predictions before merging inference results (#817)

* SLEAP v1.2.4

* SLEAP v1.2.4

No version left behind

* Remove cli.rst (back from the dead)

* Add read/write adaptor for ndx-pose (#835)

- Reads/writes predicted instances to NWB file.

* Change existing skeleton to match skeleton loaded via "Load Skeleton" button (#840)

* Fix Save As bug (#845)

* 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)

Update to SLEAP v1.2.5

* Fix NWB conda packaging (#860)

* Add pynwb and ndx-pose to conda packages

* Bump to v1.2.6

Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com>
Co-authored-by: sheridana <asheridan@salk.edu>
Co-authored-by: Arlo Sheridan <38435167+sheridana@users.noreply.github.com>
Co-authored-by: David Samy <96505813+davidasamy@users.noreply.github.com>

Co-authored-by: Talmo Pereira <talmo@salk.edu>
Co-authored-by: sheridana <asheridan@salk.edu>
Co-authored-by: Arlo Sheridan <38435167+sheridana@users.noreply.github.com>
Co-authored-by: David Samy <96505813+davidasamy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant