# cseeyangchen/flora architecture

> Architecture diagram of the GitHub repository cseeyangchen/flora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cseeyangchen/flora
- Repository: https://github.com/cseeyangchen/flora

## Overview

Flora is a research implementation for zero-shot skeleton action recognition. Its documented workflow prepares NTU or PKU-MMD skeleton data, optionally pretrains a Shift-GCN encoder or uses pre-extracted features, then runs the main training/evaluation entry point. The sampled mapping model combines motion and text semantics with learned encoders/decoders and uses CLIP-derived class embeddings. Trainer internals and several documented capabilities are not shown in the excerpts, so those links are left unspecified rather than inferred.

Main entry points: [`pretrain_skeleton/main.py`](https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/main.py) (Encoder pretraining), [`trainer.py`](https://github.com/cseeyangchen/flora/blob/main/trainer.py) (Training and evaluation), [`models/fm.py`](https://github.com/cseeyangchen/flora/blob/main/models/fm.py) (Mapping network), [`data/ntu60/get_raw_skes_data.py`](https://github.com/cseeyangchen/flora/blob/main/data/ntu60/get_raw_skes_data.py) (NTU extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_ntu_extract["NTU extraction"]
  node_ntu_clean["NTU denoising"]
  node_ntu_transform["NTU transform"]
  node_pku_extract["PKU extraction"]
  node_pku_generate["PKU generation"]
  node_pku_process["PKU preprocessing<br/>[preprocess_pku.py]"]
  node_pku_concat["PKU concatenation<br/>[pku_concat.py]"]
end

subgraph group_encoder["Skeleton encoding"]
  node_pretrain_entry["Encoder pretraining<br/>[main.py]"]
  node_pretrain_feeder["Skeleton feeder<br/>[feeder_ntu.py]"]
  node_shiftgcn["Shift-GCN<br/>[shift_gcn.py]"]
end

subgraph group_recognition["Zero-shot recognition"]
  node_main["Recognition entry<br/>[main.py]"]
  node_trainer["Training and evaluation<br/>[trainer.py]"]
  node_feeder["Feature feeder<br/>[feeder_ntu.py]"]
end

subgraph group_semantics["Semantic mapping"]
  node_mapping["Mapping network<br/>[fm.py]"]
  node_dit["Diffusion transformer<br/>[dit.py]"]
end

node_researcher(("Researcher"))
node_ntu_raw[("Raw NTU skeletons")]
node_pku_raw[("Raw PKU skeletons")]
node_features[("Skeleton features")]
node_clip["CLIP text model"]
node_results["Recognition results"]

node_researcher -->|"provides"| node_ntu_raw
node_researcher -->|"provides"| node_pku_raw
node_ntu_raw -->|"reads skeletons"| node_ntu_extract
node_ntu_extract -->|"extracts bodies"| node_ntu_clean
node_ntu_clean -->|"cleans sequences"| node_ntu_transform
node_pku_raw -->|"reads skeletons"| node_pku_extract
node_pku_extract -->|"generates data"| node_pku_generate
node_pku_generate -->|"creates sequences"| node_pku_process
node_pku_process -->|"downsamples data"| node_pku_concat
node_researcher -->|"starts pretraining"| node_pretrain_entry
node_pretrain_entry -->|"loads samples"| node_pretrain_feeder
node_pretrain_entry -->|"trains encoder"| node_shiftgcn
node_researcher -.->|"provides features"| node_features
node_researcher -->|"starts experiment"| node_main
node_main -->|"starts training"| node_trainer
node_researcher -->|"selects feature input"| node_features
node_features -->|"supplies features"| node_feeder
node_trainer -->|"produces evaluation"| node_results
node_clip -->|"encodes prompts"| node_mapping
node_mapping -->|"uses diffusion model"| node_dit
node_trainer -->|"trains or evaluates"| node_mapping

click node_ntu_extract "https://github.com/cseeyangchen/flora/blob/main/data/ntu60/get_raw_skes_data.py"
click node_ntu_clean "https://github.com/cseeyangchen/flora/blob/main/data/ntu60/get_raw_denoised_data.py"
click node_ntu_transform "https://github.com/cseeyangchen/flora/blob/main/data/ntu60/seq_transformation.py"
click node_pku_extract "https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_part1_skeleton.py"
click node_pku_generate "https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_part1_gendata.py"
click node_pku_process "https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/preprocess_pku.py"
click node_pku_concat "https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_concat.py"
click node_pretrain_entry "https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/main.py"
click node_pretrain_feeder "https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/feeders/feeder_ntu.py"
click node_shiftgcn "https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/model/shift_gcn.py"
click node_main "https://github.com/cseeyangchen/flora/blob/main/main.py"
click node_trainer "https://github.com/cseeyangchen/flora/blob/main/trainer.py"
click node_feeder "https://github.com/cseeyangchen/flora/blob/main/feeders/feeder_ntu.py"
click node_mapping "https://github.com/cseeyangchen/flora/blob/main/models/fm.py"
click node_dit "https://github.com/cseeyangchen/flora/blob/main/models/dit.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ntu_extract,node_ntu_clean,node_ntu_transform,node_pku_extract,node_pku_generate,node_pku_process,node_pku_concat toneBlue
class node_pretrain_entry,node_pretrain_feeder,node_shiftgcn,node_ntu_raw,node_pku_raw,node_features toneAmber
class node_main,node_trainer,node_feeder toneMint
class node_mapping,node_dit toneRose
class node_researcher,node_clip,node_results toneIndigo
```

## Components

### Data preparation

- [NTU extraction](https://github.com/cseeyangchen/flora/blob/main/data/ntu60/get_raw_skes_data.py): `data/ntu60/get_raw_skes_data.py`
- [NTU denoising](https://github.com/cseeyangchen/flora/blob/main/data/ntu60/get_raw_denoised_data.py): `data/ntu60/get_raw_denoised_data.py`
- [NTU transform](https://github.com/cseeyangchen/flora/blob/main/data/ntu60/seq_transformation.py): `data/ntu60/seq_transformation.py`
- [PKU extraction](https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_part1_skeleton.py): `data/pkummd/part1/pku_part1_skeleton.py`
- [PKU generation](https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_part1_gendata.py): `data/pkummd/part1/pku_part1_gendata.py`
- [PKU preprocessing](https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/preprocess_pku.py): `data/pkummd/part1/preprocess_pku.py`
- [PKU concatenation](https://github.com/cseeyangchen/flora/blob/main/data/pkummd/part1/pku_concat.py): `data/pkummd/part1/pku_concat.py`

### Skeleton encoding

- [Encoder pretraining](https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/main.py): `pretrain_skeleton/main.py`
- [Skeleton feeder](https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/feeders/feeder_ntu.py): `pretrain_skeleton/feeders/feeder_ntu.py`
- [Shift-GCN](https://github.com/cseeyangchen/flora/blob/main/pretrain_skeleton/model/shift_gcn.py): `pretrain_skeleton/model/shift_gcn.py`

### Zero-shot recognition

- [Recognition entry](https://github.com/cseeyangchen/flora/blob/main/main.py): `main.py`
- [Training and evaluation](https://github.com/cseeyangchen/flora/blob/main/trainer.py): `trainer.py`
- [Feature feeder](https://github.com/cseeyangchen/flora/blob/main/feeders/feeder_ntu.py): `feeders/feeder_ntu.py`

### Semantic mapping

- [Mapping network](https://github.com/cseeyangchen/flora/blob/main/models/fm.py): `models/fm.py`
- [Diffusion transformer](https://github.com/cseeyangchen/flora/blob/main/models/dit.py): `models/dit.py`

### Other components

- **Researcher**
- **Raw NTU skeletons**
- **Raw PKU skeletons**
- **Skeleton features**
- **CLIP text model**
- **Recognition results**

## Connections

- Researcher → Raw NTU skeletons: provides
- Researcher → Raw PKU skeletons: provides
- Raw NTU skeletons → NTU extraction: reads skeletons
- NTU extraction → NTU denoising: extracts bodies
- NTU denoising → NTU transform: cleans sequences
- Raw PKU skeletons → PKU extraction: reads skeletons
- PKU extraction → PKU generation: generates data
- PKU generation → PKU preprocessing: creates sequences
- PKU preprocessing → PKU concatenation: downsamples data
- Researcher → Encoder pretraining: starts pretraining
- Encoder pretraining → Skeleton feeder: loads samples
- Encoder pretraining → Shift-GCN: trains encoder
- Researcher → Skeleton features: provides features
- Researcher → Recognition entry: starts experiment
- Recognition entry → Training and evaluation: starts training
- Researcher → Skeleton features: selects feature input
- Skeleton features → Feature feeder: supplies features
- Training and evaluation → Recognition results: produces evaluation
- CLIP text model → Mapping network: encodes prompts
- Mapping network → Diffusion transformer: uses diffusion model
- Training and evaluation → Mapping network: trains or evaluates
