Tags: talmolab/sleap
Tags
SLEAP 1.3.0a0 (#1192) * GUI Training: Use hidden params from loaded config (#1053) * Add optional unragging arg to model export (#1054) * Fix config option to `split_by_inds` (#1060) * Convert training, validation, and test to Labels object * Add test for split_by_inds * Use Labels.extract instead of Labels(List[LabeledFrames]) * Tracking: robust assignment of the best score to an instance (#1062) * Set max instances for top down models (#1070) * Add optional unragging arg to model export * Add option to set max instances for multi-instance models * Fix test * Don't create instances during inference if no points were found (#1073) * Don't create instances during inference if no points were found * Add points check for all predictors * Fix single instance predictor logic and test * Add tests for all predictors Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com> * Add one-line fix to VideoWriterSkyvideo (#1082) * Fix parser for sleap-export (#1085) * Refactor commands to load project as `AppCommand`s (#1098) * Add working Proof of Concept * Create command class for loading project * Split `LoadProjectFile` as a subclass of `LoadLabelsObject` * Reroute last existing reference * Remove debugging code * Flexibly resize input layer of `tf.keras.Model` upon loading trained model (#1084) * Add initial implementation (auto output stride problematic) * Add to load_predictor test (error when auto-compute output stride) * Use output stride from config instead of auto-computing * Fix output-stride/padding modulo error and do not resize on export * Fix resizing bug in multi-class predictors * Non-functional clean-up * Rename new input layer to original name * Add inference integration test * Minimize config surgery, generalize layer iteration Co-authored-by: Talmo Pereira <talmo@salk.edu> * Add Option to Make Trail Shade Darker/Lighter (#1103) * Make trails 60% darker than track color * Add menu option for shade of trails * Remove unexpected indent (fat-fingered) * Create signal that updates plot instead of removing and replotting items (#1134) * Create signal that updates plot instead of redrawing * Remove debug code * Non-functional self-review changes * Fix symmetric skeletons (via table input) (#1136) Ensure variable initialized before calling it * Nix export of tracking results (#1068) * [io] export tracking results to NIX file * [io] nix added to export filter only if available * [nixio] refactor, add scores link data as mtag * [nixio] speeding up export by chunked writing * [nixio] rename point score to node score * [nixio] fix missing dimension descriptor for node scores * [export analysis] support multiple formats also for bulk export * [nixio] export centroid, some documentation * [nixio] fix double dot before filename suffix * [nixio] fix bug when not all nodes were found * [nixio] housekeeping * [nix] add nix analyis output format to convert * [nix] tiny fix, catch file write error and properly close file * [inference] main takes optional args. Can be imported to run inference form scripts * [convert] simplify if else structure and outfile handling for analysis export * [nix] use pathlib instead of os * [nix] catch if there are instances with a None frame_idx ... not sure why this occurred. The nix adaptor cannot save instances that are not related to a frame. * [nix] move checks to top of write function * [nix] use absolute imports * [nix] use black to reformat * [commands] revert qtpy import and apply code style * [convert] use absolute imports, apply code style * [commands]fix imports * [inference/nix]fix linter complaint, adjust nix types for scores * [nix] add test case for nix export format * [nix] extended testing, some modifications of adaptor * [skeleton] add __eq__ to Skeleton ... make Node.name and Node.weight instance variables instead of class variables * [nix] add nixio to requirements, remove unused nix_available, ... allow for non-unique entries in node, track and skeleton. Extend node map to store the skeleton it is part of * [nix] make the linter happy * [Node] force definition of a name Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * [nix] use getattr for getting grayscale information Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * [nix] fixes according to review * [convert] break out of loop upon finding the video Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * [commands.py] use pathilb instead of splitting filename Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * [dev requirements] remove linebreak at last line * [skeleton] revert attribute creation back to original * [nix] break lines in class documentation * Ensure all file references are closed * Make the linter happy * Add tests for ExportAnalysis and (docs for) sleap-convert Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Fix body vs symmetry subgraph filtering (#1142) Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Handle changing backbones in training editor GUI (#1140) Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Added scaling functionality for both the instances and bounding box. (#1133) * Create VisibleBoundingBox class. * Added instance scaling functionality in addition to bounding box scaling functionality. * Update sleap/gui/widgets/video.py Co-authored-by: Talmo Pereira <talmo@salk.edu> * Update sleap/gui/widgets/video.py Co-authored-by: Talmo Pereira <talmo@salk.edu> * Update sleap/gui/widgets/video.py Co-authored-by: Talmo Pereira <talmo@salk.edu> * Update sleap/gui/widgets/video.py Co-authored-by: Talmo Pereira <talmo@salk.edu> * Update sleap/gui/widgets/video.py Co-authored-by: Talmo Pereira <talmo@salk.edu> * Added new testing for scaling operation and simplified VisibleBoundingBox class code. * Added type hinting to the scaling padding and removed erroneous bounding rect initialization. Co-authored-by: Talmo Pereira <talmo@salk.edu> Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Add better error message for top down (#1121) * Add better error message for top down * Add test for error message * Raise different error, fix test * Hotfix for video save #1098 (#1148) * Add a hotfix for #1098 * WIP: Add test for detecting changes on load * Finialize change on load test * Remove unused imports * Skip test if on windows since files are being used in parallel * Add central padding to SizeMatcher (#1129) * add center padding to size matcher * add test for center padding * add ensure_float option to inference layer * reformat resizing and test_resizing * Remove redundant operation * Replace existing constants with fixtures --------- Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Added MoveNet as an external model reference (#1141) * add center padding to size matcher * add test for center padding * add ensure_float option to inference layer * reformat resizing and test_resizing * add MoveNet as an external model inference * add the movenet to the from_model_paths * add tests * add comments to movenet predictor * add tensorflow_hub to the requirements.txt * modified default video path * resolved most of the comments except expanding the predictor * expanded Predictor.from_model_paths function to include any pre-trained models. * add test_load_model * added from_trained_models in class Predictor and modified test_load_model for it. * modified test_load_model to be more generalized. * moved pretrained model from Predictor.from_trained_model to Predictor.from_model_paths and added a test for it. * Fix Predictor.from_model_paths and tests * Rename load_movenet_model to make_model_movenet * minor clean-up * Remove redundant operation * Replace existing constants with fixtures * Handle loading movenet models via load_model API * Clean-up doc strings --------- Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Resumable Training (#1130) * add resume training functionality * add testing function for resume training functionality * linting black * Resumable Training 2 - CLI Options (#1131) * add cli options for resumable training * add test for cli resume training * black linting for cli resumable training * simplify resumable checkpoint CLI fn to a single CLI arg (#1132) * simplify resumable checkpoint CLI fn to a single CLI arg * Adam/resumable training 3 (#1150) * correct path of labels_path for test_training * add resume training to gui * add train from scratch message * Add finishing touches to resumable training PR (#1150) (#1168) * Refactor/update 'use trained' and 'resume training' checkbox logic * Simplify checkbox logic and reset model field when resume training * Reset checkboxes upon changing config selection * Handle case for updating TrainingEditor when sender is not a checkbox * Add complete state space GUI test for checkboxes * Finish combobox test * Test that form is reset * Remove straggling TODO --------- Co-authored-by: roomrys <38435167+roomrys@users.noreply.github.com> Co-authored-by: jimzers <jimzersml@gmail.com> --------- Co-authored-by: jimzers <jimzersml@gmail.com> Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Return trainer from sleap-train and check that trainer configured correctly * Add CLI documentation for website --------- Co-authored-by: jimzers <jimzersml@gmail.com> Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Small (final?) revisions and fix test * Revert changes to fixture --------- Co-authored-by: jimzers <jimzersml@gmail.com> Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * GenericTableModel/View improvements (#1163) * [dataviews] GenericTableModel/View improvements ... * GenericTableView got a new argument specifying whether the ellipsis for long cell content should be right (old behavior, default) or left useful for long content such as the filenames in the video table. * GenericTableView uses all the space that available to the table. * The model's data function returns the full cell content to be shown as tool tip text. * [gui/app] set the ellipsis to be on the left for long table contents --------- Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Add Skeleton Templates (#1122) * Update docs: change 'M1' to 'Apple Silicon' (#1188) * Bump to 1.3.0a0 (#1189) --------- Co-authored-by: sheridana <asheridan@salk.edu> Co-authored-by: getzze <getzze@gmail.com> Co-authored-by: Talmo Pereira <talmo@salk.edu> Co-authored-by: Jan Grewe <jngrewe@googlemail.com> Co-authored-by: Sean Afshar <84047864+sean-afshar@users.noreply.github.com> Co-authored-by: Jiaying Hsu <72051972+jiayinghsu@users.noreply.github.com> Co-authored-by: Adam Lee <38634441+jimzers@users.noreply.github.com> Co-authored-by: jimzers <jimzersml@gmail.com> Co-authored-by: Jan Grewe <jan.grewe@g-node.org> Co-authored-by: Aaditya Prasad <78439225+aaprasad@users.noreply.github.com>
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>
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)