-
Notifications
You must be signed in to change notification settings - Fork 100
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
Miscellaneous QOL #467
Merged
Merged
Miscellaneous QOL #467
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Adjust version detection in setup.py
- Add selected frame count - Add total videos
- Instance, PredictedInstance, Skeleton - Tweak Video str - Expand labels.describe() - Add symmetry_names property to Skeleton - Add scores property to PredictedInstance - Typos, docstrings, formatting
- Default filename is now "labels.v000.slp" to encourage versioning best practices
- Add button to reset shortcuts to defaults - Add dialog to notify user about needing to restart app
- Add --reset flag in case things get messed up
- Rewrote CLI. - Now uses more standardized methods for data loading, model building, and inference. - Remove most of the dynamically generated args in favor of a flat list of args. - Deprecate a bunch of redundant args. These still work, they're now just hidden from the help. - Enable single provider inference for labels rather than predicting video-by-video. - More informative logging. - Add option for removing empty frames. By default it keeps empty frames (#396) - Add a lot more provenance information. - Unified inference progress bar for GUI, console AND notebooks (#453)! - JSON progress output for custom handling via stdout capture. - Add Predictor.from_model_paths() constructor for single entrypoint instantiation of subclasses from paths. - Remove unused imports and MockPredictor class. - Add peak_threshold to load_model() high level API. - Docstrings and typing
- export_dataset_gui for saving labels with embedded images with a progress bar - open_website to launch browser from URL - open_file to launch native system file browser - copy_to_clipboard to copy string to system clipboard
- Generates training labels package with embedded images, training job configs, training scripts, and inference scripts - Packages everything into a zip file - Displays dialog with options to open containing folder or open browser to pre-specified Colab notebook for remote training + copies path to clipboard (user just needs to upload the package and run)
talmo
requested review from
arie-matsliah
and removed request for
arie-matsliah
February 5, 2021 10:12
- Add more logging to training data builders - Persist indices if split by fraction
- Add propagate track labels option to allow for direct set of track without affecting other frames - Fix state persistence in prefs for some options
- Docstring formatting
- Split AFTER filtering for user labels - Count dataset sizes by the reader objects instead of labels to account for possible filtering
talmo
added a commit
that referenced
this pull request
Mar 24, 2021
* Add track indices to instance cropper * Add class vector generator * Split class vectors correctly in instance cropper * Move head output layer construction to heads module - Heads now subclass a base Head class - Naming doesn't include _0 anymore since we don't have any multi-output models for now. - Better input validation in Model.from_config constructor - Add loss weight to all heads in config - Test coverage for heads and (minimally for) model * Add topdown config, head and model - Rename multiclass to multiclass_bottomup * Add trainer * Data pipeline * Apply black to 'sleap' and 'tests' (#465) Co-authored-by: Arie Matsliah <[email protected]> * Fix model creation and add pooling param to head * Symmetry-aware flip augmentation (#455) * Implement symmetry-aware instance reflection * Fix symmetries sometimes not being returned uniquely * Add fancier indexing to instances * Add random flipping transformer * Fix failing linux test - Make sure indices are all cast to int32 * Add vertical flip * Add flip augmentation to config, GUI and pipeline builders * Update profiles with default fields Co-authored-by: ariematsliah-princeton <[email protected]> * Multi-size videos in data pipelines (#440) Add support for variable size videos within the same dataset by matching their size with padding or resizing Co-authored-by: Arie Matsliah <[email protected]> * Type check + Lint in CI (#470) * Try lint and typecheck in CI workflow * update * nit * continue on MyPy errors * test * correct * correct * correct Co-authored-by: Arie Matsliah <[email protected]> * Rename predictors for consistency with inference layers - TopdownPredictor -> TopDownPredictor - BottomupPredictor -> BottomUpPredictor * Create PULL_REQUEST_TEMPLATE.md * Update authors list (#471) Co-authored-by: Arie Matsliah <[email protected]> * Add CLA (#473) * Add CLA * update links Co-authored-by: Arie Matsliah <[email protected]> * Update PULL_REQUEST_TEMPLATE.md * Miscellaneous QOL (#467) Pre-1.1.0 update features (changelist in #467) * Bump pre-release version * Add back load_model that got lost in the merge - Add detection of bottomup and topdown multi-class model loading * Fix more missing things post-merge * Fix lint * Fix training from config * Add inference * Tweak describe tensor to accept nested tuples/dicts * Lint * Fix test * Lint * Fix load video dataset arg * Fix inference * Fix evals * Add BU MC to evals * Remove batch norm from TD MC head * Add option to disable batch norm in pretrained models * Add track matching when merging labels * Don't error when training finishes with no inference target Co-authored-by: ariematsliah-princeton <[email protected]> Co-authored-by: Arie Matsliah <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Laundry list of small features and tweaks:
High level APIs:
sleap.load_video()
: create asleap.Video
from filenamesleap.load_config()
: load training job config json from model folderssleap.load_file()
now takes amatch_to
kwarg to align data structure instances with other labels for easy comparison and manipulation.sleap.versions()
: print package/OS versionsLabels
,LabeledFrame
,Instance
,PredictedInstance
,Video
,Skeleton
now all have readable__repr__
and__str__
, and__len__
for easy inspection of contents (nodes, visible parts).Labels.extract()
to pull out a subset of frames into new labels while retaining metadata from the base labels.Labels.export()
to save to analysis HDF5Labels.numpy()
,LabeledFrame.numpy()
to convert main data structures to numpyLabels.describe()
is more comprehensive overview of a dataset.Labels.load_deeplabcut_folder()
to interactively import a maDLC dataset.Core workflow
Labels.clear_suggestions()
,Labels.unlabeled_suggestions
,Labels.get_unlabeled_suggestion_inds()
,Labels.remove_empty_frames()
,LabelsReader.from_user_labeled_frames()
,LabelsReader.from_unlabeled_suggestions()
to support suggestion-driven workflowsleap.load_model()
.labels.v000.slp
as the default filename and scans the containing directory for labels following this pattern to increment the version number automatically. Saving the labels to a new version now takes just two keyboard strokes (Ctrl + Shift + S -> Enter by default). These two changes should direct users towards label versioning best practices.GUI/UX
name
anddescription
fields toTrainingJobConfig
to make it easier to annotate preset profiles with information relevant for users to select between them. This will be displayed in the GUI in a future update to drive a simplified training dialog workflow.Training/inference
config.outputs.save_visualizations
works when--save_viz
is not passed).labels_path
arg since this can be specified in the config like the validation and test splits.config.outputs.delete_viz_images
is true (the default). This was often larger than the models themselves and usually only used during GUI-based training for live visualization.self.config.outputs.zip_outputs
is true to support core remote workflow.sleap.load_model()
now supports loading models from zip files to support core remote workflow.sleap.nn.inference
submodule: deleted unused classes and methods and move a lot of functionality to thePredictor
base class.tf.keras.Model.predict_on_batch()
in inference loops to drastically improve speed by cached traced/autographed model call every batch.rich
or by outputting JSON-encoded updates tostdout
which can be captured by any caller. FPS and ETA are now calculated using a recent rolling buffer for more accurate estimates without needing to wait for startup/autograph amortization.sleap-track
) to make it much, much clearer and follow a more linear workflow. Deprecated many redundant args (still supported but hidden fromsleap-track -h
).data_path
argument (e.g.,sleap-track -m path/to/model "labels.slp"
) without using the--labels
flag.LabelsReader
/VideoReader
provider to iterate over all inference targets. Previously, this was restarted per video, slowing down the whole process.Labels.provenance
before saving, including system info, paths, sleap version, timestamps, etc.TrainingJobConfig
now caches the sleap version and filename it was loaded from and saved to during I/O opsFixes
Instances
/PredictedInstances
. This affects the model folder auto-naming, labeled instance count in suggestions table and more.sleap-label
will now run in CPU-only mode to prevent pre-allocating all the GPU memory if any tensorflow ops are called.sleap.load_model()
will now default to disabling pre-allocation of all the GPU memory even if called interactively to prevent the same issue.