DeepLabCut 3.0 - Video Analysis with use_shelve=True
#2790
Merged
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.
Implements shelving data during video analysis for the PyTorch engine.
DeepLabCut 3.0 new API features -
analyze_videosuse_shelverobust_nframesparameter for theanalyze_videosChanges to the code
ShelfReaderand aShelfWriterindeeplabcut.pose_estimation_pytorch.runners.shelvingShelfWriternow creates the_full.picklefile on-the-fly,assign_identityis called in a newAssignIndividualIdentitiespost-processor instead of invideo_inference(which is an improvement on the previous implementation)Notes
When reading from the
ShelfReader, the order of keys returned does not necessarily match the order in which the keys were inserted. This could cause the predictions for frames to be shuffled when iterating over the frame keys. To solve this issue, thenframesparameter is now used to iterate over the number of frames in the video (in_generate_assemblies_fileand inconvert_detections2tracklets), and a "key_str_width" parameter is added to the metadata, storing thestr_widthparameter so that frame keys can be recreated from the frame index.