# stellarenam/humankeypointandcommondetect architecture

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

- Interactive diagram: https://gitdiagram.com/stellarenam/humankeypointandcommondetect
- Repository: https://github.com/stellarenam/humankeypointandcommondetect

## Overview

The repository is an edge-inference demo combining single-person pose/action recognition, YOLOX object detection, and HTTP/MJPEG result sharing. Its main user workflow is camera frames into a detector, then annotated images or structured results; transfer nodes expose those outputs to browsers or other devices. The README documents the intended camera-to-detection-to-transfer chaining. Source excerpts show the common-detection internals and pose processing, but do not show how the visual workflow tool wires its nodes together.

Main entry points: [`HumanDet/code/keypoint_detect.py`](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_detect.py) (Pose workflow node), [`CommonDet/code/common_det.py`](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_det.py) (CommonDetect), [`CommonDet/code/common_detect.py`](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_detect.py) (Detection workflow node), [`data_transfer/视频推流.py`](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/%E8%A7%86%E9%A2%91%E6%8E%A8%E6%B5%81.py) (MJPEG stream node)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pose["Pose detection"]
  node_pose_rec["Pose inference<br/>[keypoint_det.py]"]
  node_pose_action["Action rules<br/>[keypoint_det.py]"]
  node_pose_view["Pose overlay<br/>[keypoint_det.py]"]
  node_pose_node["Pose workflow node<br/>[keypoint_detect.py]"]
end

subgraph group_objects["Object detection"]
  node_common_entry["CommonDetect<br/>[common_det.py]"]
  node_common_pre["Letterbox preprocessing<br/>[utils.py]"]
  node_onnx_runner["ONNX Runtime<br/>[onnx_infer.py]"]
  node_common_post["Decode and NMS<br/>[utils.py]"]
  node_class_config["Classes and settings<br/>[aiconfig.py]"]
  node_common_view["Detection overlay<br/>[visualize.py]"]
  node_common_node["Detection workflow node<br/>[common_detect.py]"]
end

subgraph group_transfer["Device transfer"]
  node_video_node["MJPEG stream node<br/>[视频推流.py]"]
  node_video_queue["Frame queue<br/>[视频推流.py]"]
  node_http_data["HTTP data node<br/>[HTTP数据发送8089.py]"]
  node_http_blue["Bluetooth data node<br/>[HTTP数据发送8090.py]"]
end

subgraph group_models["ONNX models"]
  node_keypoint_model["Keypoint model<br/>[keypoint.onnx]"]
  node_yolox_model["YOLOX model<br/>[yolox_nano.onnx]"]
end

node_camera(("Camera"))
node_browser(("Browser viewer"))
node_device(("Remote device"))

node_camera -.->|"supplies frames"| node_pose_node
node_pose_node -.->|"runs detection"| node_pose_rec
node_pose_rec -->|"loads model"| node_keypoint_model
node_pose_node -->|"classifies pose"| node_pose_action
node_pose_node -->|"draws overlay"| node_pose_view
node_camera -.->|"supplies frames"| node_common_node
node_common_node -.->|"runs detection"| node_common_entry
node_common_entry -->|"preprocesses image"| node_common_pre
node_common_entry -->|"runs inference"| node_onnx_runner
node_onnx_runner -.->|"loads model"| node_yolox_model
node_common_entry -->|"decodes and filters"| node_common_post
node_common_entry -->|"reads settings"| node_class_config
node_common_entry -->|"renders detections"| node_common_view
node_common_view -->|"uses class labels"| node_class_config
node_pose_node -.->|"forwards image"| node_video_node
node_common_node -.->|"forwards image"| node_video_node
node_video_node -->|"queues JPEG frame"| node_video_queue
node_video_queue -->|"streams MJPEG"| node_browser
node_pose_node -.->|"reports action"| node_http_data
node_common_node -.->|"reports results"| node_http_data
node_pose_node -.->|"reports results"| node_http_blue
node_http_data -->|"serves latest data"| node_device
node_http_blue -->|"serves latest data"| node_device

click node_pose_rec "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py"
click node_pose_action "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py"
click node_pose_view "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py"
click node_pose_node "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_detect.py"
click node_keypoint_model "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/models/keypoint.onnx"
click node_common_entry "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_det.py"
click node_common_pre "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/utils.py"
click node_onnx_runner "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/onnx_infer.py"
click node_yolox_model "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/models/yolox_nano.onnx"
click node_common_post "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/utils.py"
click node_class_config "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/aiconfig.py"
click node_common_view "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/visualize.py"
click node_common_node "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_detect.py"
click node_video_node "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/%E8%A7%86%E9%A2%91%E6%8E%A8%E6%B5%81.py"
click node_video_queue "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/%E8%A7%86%E9%A2%91%E6%8E%A8%E6%B5%81.py"
click node_http_data "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/HTTP%E6%95%B0%E6%8D%AE%E5%8F%91%E9%80%818089.py"
click node_http_blue "https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/HTTP%E6%95%B0%E6%8D%AE%E5%8F%91%E9%80%818090.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_pose_rec,node_pose_action,node_pose_view,node_pose_node,node_browser toneBlue
class node_common_entry,node_common_pre,node_onnx_runner,node_common_post,node_class_config,node_common_view,node_common_node toneAmber
class node_video_node,node_video_queue,node_http_data,node_http_blue toneMint
class node_keypoint_model,node_yolox_model toneRose
class node_camera,node_device toneIndigo
```

## Components

### Pose detection

- [Pose inference](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py): `HumanDet/code/keypoint_det.py`
- [Action rules](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py): `HumanDet/code/keypoint_det.py`
- [Pose overlay](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_det.py): `HumanDet/code/keypoint_det.py`
- [Pose workflow node](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/HumanDet/code/keypoint_detect.py): `HumanDet/code/keypoint_detect.py`

### Object detection

- [CommonDetect](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_det.py): `CommonDet/code/common_det.py`
- [Letterbox preprocessing](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/utils.py): `CommonDet/code/components/utils.py`
- [ONNX Runtime](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/onnx_infer.py): `CommonDet/code/components/onnx_infer.py`
- [Decode and NMS](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/utils.py): `CommonDet/code/components/utils.py`
- [Classes and settings](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/aiconfig.py): `CommonDet/code/components/aiconfig.py`
- [Detection overlay](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/components/visualize.py): `CommonDet/code/components/visualize.py`
- [Detection workflow node](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/CommonDet/code/common_detect.py): `CommonDet/code/common_detect.py`

### Device transfer

- [MJPEG stream node](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/%E8%A7%86%E9%A2%91%E6%8E%A8%E6%B5%81.py): `data_transfer/视频推流.py`
- [Frame queue](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/%E8%A7%86%E9%A2%91%E6%8E%A8%E6%B5%81.py): `data_transfer/视频推流.py`
- [HTTP data node](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/HTTP%E6%95%B0%E6%8D%AE%E5%8F%91%E9%80%818089.py): `data_transfer/HTTP数据发送8089.py`
- [Bluetooth data node](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/data_transfer/HTTP%E6%95%B0%E6%8D%AE%E5%8F%91%E9%80%818090.py): `data_transfer/HTTP数据发送8090.py`

### ONNX models

- [Keypoint model](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/models/keypoint.onnx): `models/keypoint.onnx`
- [YOLOX model](https://github.com/stellarenam/humankeypointandcommondetect/blob/main/models/yolox_nano.onnx): `models/yolox_nano.onnx`

### Other components

- **Camera**
- **Browser viewer**
- **Remote device**

## Connections

- Camera → Pose workflow node: supplies frames (evidence: `README.md`)
- Pose workflow node → Pose inference: runs detection (evidence: `README.md`)
- Pose inference → Keypoint model: loads model (evidence: `HumanDet/code/keypoint_det.py`)
- Pose workflow node → Action rules: classifies pose (evidence: `HumanDet/code/keypoint_det.py`)
- Pose workflow node → Pose overlay: draws overlay (evidence: `HumanDet/code/keypoint_det.py`)
- Camera → Detection workflow node: supplies frames (evidence: `README.md`)
- Detection workflow node → CommonDetect: runs detection (evidence: `README.md`)
- CommonDetect → Letterbox preprocessing: preprocesses image (evidence: `CommonDet/code/common_det.py`)
- CommonDetect → ONNX Runtime: runs inference (evidence: `CommonDet/code/common_det.py`)
- ONNX Runtime → YOLOX model: loads model
- CommonDetect → Decode and NMS: decodes and filters (evidence: `CommonDet/code/common_det.py`)
- CommonDetect → Classes and settings: reads settings (evidence: `CommonDet/code/common_det.py`)
- CommonDetect → Detection overlay: renders detections (evidence: `CommonDet/code/common_det.py`)
- Detection overlay → Classes and settings: uses class labels (evidence: `CommonDet/code/components/visualize.py`)
- Pose workflow node → MJPEG stream node: forwards image (evidence: `README.md`)
- Detection workflow node → MJPEG stream node: forwards image (evidence: `README.md`)
- MJPEG stream node → Frame queue: queues JPEG frame (evidence: `data_transfer/视频推流.py`)
- Frame queue → Browser viewer: streams MJPEG (evidence: `data_transfer/视频推流.py`)
- Pose workflow node → HTTP data node: reports action (evidence: `README.md`)
- Detection workflow node → HTTP data node: reports results (evidence: `README.md`)
- Pose workflow node → Bluetooth data node: reports results (evidence: `README.md`)
- HTTP data node → Remote device: serves latest data (evidence: `data_transfer/HTTP数据发送8089.py`)
- Bluetooth data node → Remote device: serves latest data (evidence: `data_transfer/HTTP数据发送8090.py`)
