-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for multiple data streams (#187)
* Multi view (#115) * [add] multiview dictionary and multiviewdataset * [add] multiview to get_dataset * [fix] copy package & type for dataset * [add] dynamic keys * [add] added Multiviewheatmaplabeled to base.basesupervisedtracker type * [add] mouse mirror dataset * [add] test dataset for Multiviewheatmap * [add] test for multiview heatmap data module * [add] hydra raise notinplementederror for regression and multiview * [add] prediction handler and keypoints structure for Multiview * [fix] keypoints for multiview in prediction is now saved in csvs correctly * [add] make_multiview_dataset * [fix] datacheck is more strict now * [change] the dataset is now stacked along channel dimension. [fix] tests are vaild now * [fix] images are stacked along the batch dimension and representation was reshaped * [add] data type to fusion * [fix] datadicts in data utils * [add] test_supervised_multiview_heatmap and skipped video_dataloader * update code to use original image and video pixel coordinates for all predictions (#117) * Squashed commit of the following: commit 9b7de3c Author: Selmaan <[email protected]> Date: Mon Sep 18 16:39:04 2023 -0400 Update config_birdCOM.yaml commit 1aae9de Author: Selmaan <[email protected]> Date: Mon Sep 18 15:59:43 2023 -0400 update configs for detector net Added params to default config need for dynamic crop algorithm and detector network. Then created a new bird config with edited fields * add bbox to dataset dictionaries add a xyhw bbox entry to dictionary for dataset results, for example and batch. Also update the base dataset class (for backwards compatability) to output a bounding box in the __getitem__ call. This 'default' bbox is just the full image dimensions * Update datasets.py fix automatic detection of image height and width * Update heatmap_tracker.py add code to convert from bounding box to original image dimension coordinates * Update test_pca.py fix keys in unit test * add bbox conversion get_loss_inputs_labeled and predict_step now call convert_bbox_coords, which converts predicted keypoints from (potentially cropped) image intrinsic coordinates to original image coordinates, using bbox info * code linting fixed code formatting following flake8 * Update heatmap_tracker.py add label reminding me to implement bbox conversion later for unlabeled data * Update augmentations.py do not resize data in the augmentation pipeline when using dynamic crop algorithm (cropping will be handled by dynamic pipeline) * Update config_birdCOM.yaml * Update scripts.py * Update .gitignore * Update datasets.py add new detector dataset, and correct previous image height and width calculation in BastTrackingDataset * Update heatmap_tracker.py transform target along with predicted keypoints from transformed image coordinates to original image coordinates * Update scripts.py fix typo in get_detector_model * Update config_birdCOM.yaml set useful parameter values for this dataset * add dynamic labeled dicts these are unused for now, will be implemented in the future for multi-instance detection * Update config_birdCOM.yaml redo COM config to be independent pipeline from later POS pipeline * Update scripts.py remove image size checking when setting up dataset. unrelated, also set 'columns for singleview pca' to None automatically if it's not set in the config * remove keypoints rescaling in predict remove rescaling of keypoints according to static config info (which is now removed). Keypoints are dynamically rescaled in model's predict_step now already! * add bbox conversion for unlabeled data update predict step and get unsupervised losses to convert keypoints predicted on unlabeled video frame data to original image coords using bbox info * update dali dataloader with frame sizes dali dataloader now outputs the size of loaded video frames in bbox info * pre computing heatmaps is very slow I think there is very little upside to having these precomputed? Creates a big lag for my use case whenever I try to create a dataset. * add bbox to DynamicDict * image_orig_dims no longer in configs removed image_orig_dims from config, so also does not need to be copied here. It will always be inferred from video/image data during inference * Update config_birdCOM.yaml * Create config_birdCOM_backup.yaml * delete commented out code * code linting * add bbox to unlabeled batch keys * changes from pull request review mostly moving convert_bbox_coords to be a function in models.base rather than a method of heatmap tracker class * fix bbox to device with images fixes edge case where frames and bbox where on separate devices * add bbox conversion unit test the test artifically crops and shifts an image and offsets the detected keypoint locations accordingly, and verifies that bbox_conversion for the original and re-cropped data match * combine multiview and dynamic crop PRs * [add] compute_metrics for multiview, it is a loop for each file (#119) * bug fix for multi-view metric computation (#121) * final bug fixes for multiview * bbox bug fix; closes #109, #120 * [docs] multiview separate * Multiview (#126) * [fix] preds_file typo to list * [fix] list of preds_file is being processed now * [add] hydra for compute metrics1 * [add] multiview heatmap context * [add] multiview heatmap context conftest * [add] dataset test * [add] mview data module test * [add] context and thir tests * [add] dynamic naming dataset basic * [fix] flake8 * PR fixes * add bbox coord transform to context models --------- Co-authored-by: themattinthehatt <[email protected]> * tweaks to streamlit to show labeled data results from all views * [fix] fiftyone app now compatible with multiple views * [fix] dataset typechecking error, new unit tests * remove detector code from multiview branch * remove detector code from multiview branch * update IO code to properly find multiview videos * update video_pipe to work for multiple views * update LitDaliWrapper to work for multiple views * semisupervised multiview training without error * bug fixes with dali augmentations * multiview semisupervised context dataloader + model tests passing * affine transform bug fix + refactoring + unit test --------- Co-authored-by: Farzad Ziaie Nezhad <[email protected]> Co-authored-by: Selmaan <[email protected]>
- Loading branch information
1 parent
4967266
commit 3c74e8b
Showing
54 changed files
with
2,832 additions
and
603 deletions.
There are no files selected for viewing
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
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
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
35 changes: 35 additions & 0 deletions
35
docs/api/lightning_pose.data.datasets.MultiviewHeatmapDataset.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
MultiviewHeatmapDataset | ||
======================= | ||
|
||
.. currentmodule:: lightning_pose.data.datasets | ||
|
||
.. autoclass:: MultiviewHeatmapDataset | ||
:show-inheritance: | ||
|
||
.. rubric:: Attributes Summary | ||
|
||
.. autosummary:: | ||
|
||
~MultiviewHeatmapDataset.height | ||
~MultiviewHeatmapDataset.num_views | ||
~MultiviewHeatmapDataset.output_shape | ||
~MultiviewHeatmapDataset.width | ||
|
||
.. rubric:: Methods Summary | ||
|
||
.. autosummary:: | ||
|
||
~MultiviewHeatmapDataset.check_data_images_names | ||
~MultiviewHeatmapDataset.fusion | ||
|
||
.. rubric:: Attributes Documentation | ||
|
||
.. autoattribute:: height | ||
.. autoattribute:: num_views | ||
.. autoattribute:: output_shape | ||
.. autoattribute:: width | ||
|
||
.. rubric:: Methods Documentation | ||
|
||
.. automethod:: check_data_images_names | ||
.. automethod:: fusion |
7 changes: 7 additions & 0 deletions
7
docs/api/lightning_pose.data.utils.MultiviewHeatmapLabeledBatchDict.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MultiviewHeatmapLabeledBatchDict | ||
================================ | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autoclass:: MultiviewHeatmapLabeledBatchDict | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
docs/api/lightning_pose.data.utils.MultiviewHeatmapLabeledExampleDict.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MultiviewHeatmapLabeledExampleDict | ||
================================== | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autoclass:: MultiviewHeatmapLabeledExampleDict | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
docs/api/lightning_pose.data.utils.MultiviewLabeledBatchDict.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MultiviewLabeledBatchDict | ||
========================= | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autoclass:: MultiviewLabeledBatchDict | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
docs/api/lightning_pose.data.utils.MultiviewLabeledExampleDict.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
MultiviewLabeledExampleDict | ||
=========================== | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autoclass:: MultiviewLabeledExampleDict | ||
:show-inheritance: |
17 changes: 17 additions & 0 deletions
17
docs/api/lightning_pose.data.utils.MultiviewUnlabeledBatchDict.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
MultiviewUnlabeledBatchDict | ||
=========================== | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autoclass:: MultiviewUnlabeledBatchDict | ||
:show-inheritance: | ||
|
||
.. rubric:: Attributes Summary | ||
|
||
.. autosummary:: | ||
|
||
~MultiviewUnlabeledBatchDict.is_multiview | ||
|
||
.. rubric:: Attributes Documentation | ||
|
||
.. autoattribute:: is_multiview |
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
6 changes: 6 additions & 0 deletions
6
docs/api/lightning_pose.data.utils.undo_affine_transform_batch.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
undo_affine_transform_batch | ||
=========================== | ||
|
||
.. currentmodule:: lightning_pose.data.utils | ||
|
||
.. autofunction:: undo_affine_transform_batch |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
convert_bbox_coords | ||
=================== | ||
|
||
.. currentmodule:: lightning_pose.models.base | ||
|
||
.. autofunction:: convert_bbox_coords |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
normalized_to_bbox | ||
================== | ||
|
||
.. currentmodule:: lightning_pose.models.base | ||
|
||
.. autofunction:: normalized_to_bbox |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _inference: | ||
|
||
######### | ||
Inference | ||
######### | ||
|
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
Oops, something went wrong.