docs: add CLI usage for TKG Level 1 builder

- Add Usage section with CLI commands
- TKG Level 1 builder: python scripts/tkg_level1_builder.py
- Query example for person_trace nodes
This commit is contained in:
Accusys
2026-06-22 03:24:04 +08:00
parent 9e0a0227ea
commit d0858f288a

View File

@@ -256,6 +256,48 @@ else:
---
## Usage
### CLI Commands
#### TKG Level 1 Builder
Build person_trace nodes with Level 1 features:
```bash
# Basic usage (auto-detect video and pose.json paths)
python scripts/tkg_level1_builder.py --file-uuid <uuid> --schema dev
# With explicit paths
python scripts/tkg_level1_builder.py \
--file-uuid <uuid> \
--schema dev \
--video /path/to/video.mp4 \
--pose-json /path/to/pose.json
```
Output: Creates `person_trace` nodes in `tkg_nodes` table with:
- frame_count
- height_estimate (from shoulder_width or head_width)
- level1_features (body, head_top, upper_body, lower_body colors)
#### Query TKG Nodes
```python
import psycopg2
conn = psycopg2.connect('postgresql://accusys@localhost:5432/momentry')
cur = conn.cursor()
cur.execute("SELECT external_id, properties FROM dev.tkg_nodes WHERE node_type='person_trace'")
for row in cur.fetchall():
external_id, props = row
print(f'{external_id}: height={props["height_estimate"]["estimated_height_cm"]}cm')
```
---
## Appearance Feature Location Mapping
### Environment Factors