-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Added high-level diagrams #3042
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
Open
ivanmilevtues
wants to merge
1
commit into
DeepLabCut:main
Choose a base branch
from
CodeBoarding:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,133 @@ | ||
| ```mermaid | ||
|
|
||
| graph LR | ||
|
|
||
| Multi_Animal_Tracking["Multi-Animal Tracking"] | ||
|
|
||
| Refinement["Refinement"] | ||
|
|
||
| Post_processing["Post-processing"] | ||
|
|
||
| Pose_Estimation_3D["Pose Estimation 3D"] | ||
|
|
||
| Multi_Animal_Tracking -- "provides to" --> Refinement | ||
|
|
||
| Refinement -- "provides to" --> Post_processing | ||
|
|
||
| Refinement -- "provides to" --> Pose_Estimation_3D | ||
|
|
||
| Pose_Estimation_3D -- "uses" --> Post_processing | ||
|
|
||
| click Post_processing href "https://github.com/DeepLabCut/DeepLabCut/blob/main/.codeboarding//Post_processing.md" "Details" | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
|
|
||
| [](https://github.com/CodeBoarding/GeneratedOnBoardings)[](https://www.codeboarding.org/demo)[](mailto:contact@codeboarding.org) | ||
|
|
||
|
|
||
|
|
||
| ## Details | ||
|
|
||
|
|
||
|
|
||
| The `Advanced Analysis & Post-processing` subsystem is crucial for transforming raw pose estimation outputs into refined, accurate, and insightful behavioral data. It encompasses several key stages, including multi-animal identity management, data cleaning, 3D reconstruction, and general data enhancement. This modular design aligns with the project's emphasis on a pipeline-driven and data-centric architecture, ensuring that each step of data refinement is handled by specialized, decoupled components. | ||
|
|
||
|
|
||
|
|
||
| ### Multi-Animal Tracking | ||
|
|
||
| This component is responsible for maintaining individual identities across frames in multi-animal scenarios. It includes functionalities for training and inference of re-identification models (e.g., DLCTrans), creating tracking datasets, and preprocessing tracking data. Its purpose is to enable the analysis of complex social behaviors by ensuring consistent individual identification. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_tracking_pytorch/apis.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_tracking_pytorch/apis.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_tracking_pytorch/create_dataset.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_tracking_pytorch/create_dataset.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_tracking_pytorch/tracking_utils/preprocessing.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_tracking_pytorch/train_dlctransreid.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_tracking_pytorch/inference.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_tracking_pytorch/inference.py`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### Refinement | ||
|
|
||
| This component focuses on improving the quality and continuity of pose estimation and tracking data. It identifies and corrects outlier frames (e.g., using statistical models like SARIMAX) and stitches fragmented tracklets to ensure smooth and accurate trajectories for each individual. This is vital for downstream analysis accuracy. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/refine_training_dataset/outlier_frames.py" target="_blank" rel="noopener noreferrer">`deeplabcut/refine_training_dataset/outlier_frames.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/refine_training_dataset/tracklets.py" target="_blank" rel="noopener noreferrer">`deeplabcut/refine_training_dataset/tracklets.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/refine_training_dataset/stitch.py" target="_blank" rel="noopener noreferrer">`deeplabcut/refine_training_dataset/stitch.py`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### Post-processing [[Expand]](./Post_processing.md) | ||
|
|
||
| This component provides general post-processing functionalities for the pose estimation results. This includes applying various filters to smooth trajectories, correcting minor errors, and analyzing the skeleton (e.g., calculating bone lengths or angles) to derive higher-level behavioral metrics. It serves as a versatile tool for data enhancement. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/post_processing/analyze_skeleton.py" target="_blank" rel="noopener noreferrer">`deeplabcut/post_processing/analyze_skeleton.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/post_processing/filtering.py" target="_blank" rel="noopener noreferrer">`deeplabcut/post_processing/filtering.py`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### Pose Estimation 3D | ||
|
|
||
| This component specializes in reconstructing 3D poses from 2D estimations, which is essential for depth perception and more accurate spatial analysis. It handles multi-view camera calibration, triangulating 2D keypoints into 3D coordinates, and visualizing the reconstructed 3D poses. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_3d/camera_calibration.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_estimation_3d/camera_calibration.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_3d/plotting3D.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_estimation_3d/plotting3D.py`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_3d/triangulation.py" target="_blank" rel="noopener noreferrer">`deeplabcut/pose_estimation_3d/triangulation.py`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) | ||
This file contains hidden or 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,115 @@ | ||
| ```mermaid | ||
|
|
||
| graph LR | ||
|
|
||
| Framework_Compatibility_Layer["Framework Compatibility Layer"] | ||
|
|
||
| TensorFlow_Deep_Learning_Engine["TensorFlow Deep Learning Engine"] | ||
|
|
||
| PyTorch_Deep_Learning_Engine["PyTorch Deep Learning Engine"] | ||
|
|
||
| Framework_Compatibility_Layer -- "Uses" --> TensorFlow_Deep_Learning_Engine | ||
|
|
||
| Framework_Compatibility_Layer -- "Uses" --> PyTorch_Deep_Learning_Engine | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
|
|
||
| [](https://github.com/CodeBoarding/GeneratedOnBoardings)[](https://www.codeboarding.org/demo)[](mailto:contact@codeboarding.org) | ||
|
|
||
|
|
||
|
|
||
| ## Details | ||
|
|
||
|
|
||
|
|
||
| The `Core Deep Learning Engine` subsystem in DeepLabCut is designed to abstract the complexities of underlying deep learning frameworks (TensorFlow/PyTorch) while providing robust capabilities for neural network model definition, training, inference (pose prediction), and internal evaluation. This modular design adheres to the project's emphasis on decoupling high-level application flow from specific deep learning implementations. | ||
|
|
||
|
|
||
|
|
||
| ### Framework Compatibility Layer | ||
|
|
||
| This component acts as a crucial abstraction layer, offering a unified interface for the rest of the DeepLabCut application to interact seamlessly with either the TensorFlow or PyTorch deep learning backends. It encapsulates framework-specific calls, allowing for flexible switching between implementations without altering higher-level logic. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/compat.py#L657-L975" target="_blank" rel="noopener noreferrer">`deeplabcut.compat.analyze_videos` (657:975)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/compat.py#L978-L1108" target="_blank" rel="noopener noreferrer">`deeplabcut.compat.create_tracking_dataset` (978:1108)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/compat.py#L310-L373" target="_blank" rel="noopener noreferrer">`deeplabcut.compat.return_train_network_path` (310:373)</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### TensorFlow Deep Learning Engine | ||
|
|
||
| This component is the dedicated computational engine for all deep learning operations performed using the TensorFlow framework. It encompasses the definition, training, and inference of neural network models for pose estimation, along with utilities for dataset management and model configuration specific to TensorFlow. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_tensorflow/nnets/base.py#L18-L245" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_tensorflow.nnets.base.BasePoseNet` (18:245)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_tensorflow/datasets/pose_base.py#L16-L36" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_tensorflow.datasets.pose_base.BasePoseDataset` (16:36)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_tensorflow/core/train.py#L146-L313" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_tensorflow.core.train` (146:313)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_tensorflow/core/predict.py" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_tensorflow.core.predict`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### PyTorch Deep Learning Engine | ||
|
|
||
| This component provides the core deep learning functionalities for model definition, training, and inference within the PyTorch framework. It includes a comprehensive set of APIs for various deep learning tasks, modules for data handling (preprocessing, post-processing), diverse model architectures (backbones, heads, loss functions), and runners to orchestrate training and inference workflows. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| **Related Classes/Methods**: | ||
|
|
||
|
|
||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/models/model.py#L32-L239" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.models.model.PoseModel` (32:239)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/models/backbones/base.py#L26-L83" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.models.backbones.base.BaseBackbone` (26:83)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/models/heads/base.py#L32-L140" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.models.heads.base.BaseHead` (32:140)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/models/criterions/base.py#L23-L40" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.models.criterions.base.BaseCriterion` (23:40)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/data/base.py#L36-L372" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.data.base.Loader` (36:372)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/runners/base.py#L51-L117" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.runners.base.Runner` (51:117)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/apis/training.py" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.apis.training`</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/apis/analyze_images.py#L217-L382" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.apis.analyze_images` (217:382)</a> | ||
|
|
||
| - <a href="https://github.com/DeepLabCut/DeepLabCut/blob/main/deeplabcut/pose_estimation_pytorch/apis/videos.py" target="_blank" rel="noopener noreferrer">`deeplabcut.pose_estimation_pytorch.apis.videos`</a> | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| ### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s an extra slash in the URL path (
.codeboarding//Post_processing.md), which may break the link. Please remove the duplicate slash.