How kennymckormick/pyskl works
Main Components
• Input/Preprocessing: Represent the “data” side of the system. This includes the datasets, data pipelines, and augmentation modules found in pyskl/datasets, pyskl/datasets/pipelines, and even external scripts (e.g., tools/data, examples for extraction).
• Model Building: Illustrate the various neural network modules in pyskl/models. This should clearly separate the different types – the “cnns” (3D CNN components), “gcns” (graph convolution networks like AAGCN, CTRGCN, DGSTGCN, etc.), and the “heads” which combine feature extraction with final classification.
• Training and Inference API: Encapsulate the APIs in pyskl/apis (train.py, inference.py), which orchestrate the overall training, testing, and inference workflows.
• Configuration Management: The configs directory holds configuration files for different algorithms and dataset settings. This is a central module for controlling experiments.
• Utilities and Helpers: Represent the helper modules under pyskl/utils (visualization, environment collection, graph utilities) and any extra scripts (e.g., setup files, pre-commit hooks, etc.).
• Tools & Demo: Include components from the tools and demo directories that wrap command-line scripts to launch distributed training, testing, and to preprocess the data.
• External Dependencies: Mention external libraries such as PyTorch and any additional dependencies (also visible in the YAML files) which are needed for compilation, GPU training, and possibly torch.compile for PyTorch 2.0 support.
Relationships and Data Flow
• Data and Preprocessing Flow: Display how raw skeleton data and annotations (from datasets, label maps in tools/data) flow through the pipelines in pyskl/datasets/pipelines. Clearly show that preprocessing, augmentation, and sampling modules are applied before data is forwarded to the model.
• Model Pipeline: Show the modular structure where a configuration file (YAML) is loaded, a corresponding model (from pyskl/models/) is built, and then it is fed data from the loader. Also, include how the models are wrapped with recognition or classification heads.
Architectural Patterns and Design Principles
• Modularity: Emphasize that code modules are well-separated (e.g., pipelines, datasets, models, losses) which makes it easy to swap in and out different algorithms.
• Extensibility: Indicate that the design supports multiple algorithms (ST-GCN, AAGCN, etc.) by loading algorithm-specific configuration files and modules.
• Distributed Training Support: Show that the training scripts (tools/dist_train.sh, tools/dist_test.sh) indicate that the system is designed for distributed GPU training.
• Separation of Concerns: Training and inference logic is distinct from model definition and utility functions.
Specific Elements
• External interactions, such as links to dataset preparation scripts (tools/data and demo components) and external pre-trained weights (demo, hrnet configurations).