feat(v1): add verified pose adapter

This commit is contained in:
ila
2026-07-21 09:53:03 +08:00
parent 2805905486
commit f80fb51a85
8 changed files with 267 additions and 15 deletions
+5 -5
View File
@@ -190,7 +190,7 @@ git commit -m "feat(v1): add replayable video source"
- Create: `v1/pose.py`
- Create: `v1/tests/test_pose.py`
- [ ] **Step 1: Write adapter shape tests**
- [x] **Step 1: Write adapter shape tests**
```python
def test_pose_adapter_rejects_non_pose_model(tmp_path):
@@ -202,12 +202,12 @@ def test_person_pose_has_seventeen_keypoints(fake_yolo_result):
assert len(poses[0].keypoints) == 17
```
- [ ] **Step 2: Run tests to verify failure**
- [x] **Step 2: Run tests to verify failure**
Run: `python -m pytest v1/tests/test_pose.py -v`
Expected: FAIL because `PoseAdapter` is missing.
- [ ] **Step 3: Implement only the adapter contract**
- [x] **Step 3: Implement only the adapter contract**
```python
from typing import Sequence, Tuple
@@ -226,12 +226,12 @@ class PoseAdapter:
At construction, hash the model, require task `pose`, class `person`, and exactly 17 three-value keypoints.
- [ ] **Step 4: Run tests and a real model smoke**
- [x] **Step 4: Run tests and a real model smoke**
Run: `python -m pytest v1/tests/test_pose.py -v; python -c "from ultralytics import YOLO; assert YOLO('demo/best.pt').task == 'pose'"`
Expected: PASS and no assertion error.
- [ ] **Step 5: Commit**
- [x] **Step 5: Commit**
```powershell
git add v1/pose.py v1/tests/test_pose.py docs progress.md