Metadata-Version: 2.4
Name: xthotcoco
Version: 0.1.0
Summary: xtcocotools-compatible COCO-WholeBody / CrowdPose keypoint evaluation on top of hotcoco's Rust engine
Keywords: coco,keypoints,wholebody,crowdpose,evaluation,hotcoco,xtcocotools
Author: Daisuke Nishimatsu
License-Expression: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Dist: hotcoco>=1.0,<2
Requires-Dist: numpy>=1.22
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: xtcocotools ; extra == 'test'
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/wep21/xthotcoco
Project-URL: Repository, https://github.com/wep21/xthotcoco
Provides-Extra: test
Description-Content-Type: text/markdown

# xthotcoco

xtcocotools-compatible keypoint evaluation (COCO-WholeBody, CrowdPose) on
[hotcoco](https://pypi.org/project/hotcoco/)'s Rust engine. Pure Python.

```bash
pip install xthotcoco
```

## Usage

```python
from xthotcoco import COCO, COCOeval, sigmas

gt = COCO("coco_wholebody_val_v1.0.json")
dt = gt.loadRes("results.json")
ev = COCOeval(gt, dt, "keypoints_wholebody", sigmas.WHOLEBODY)
ev.evaluate(); ev.accumulate(); ev.summarize()
print(ev.stats)

# CrowdPose
ev = COCOeval(COCO("crowdpose_test.json"), dt, "keypoints_crowd",
              sigmas.CROWD, use_area=False)
ev.run()
```

iouTypes: `keypoints`, `keypoints_wholebody`, `keypoints_foot`,
`keypoints_face`, `keypoints_lefthand`, `keypoints_righthand`,
`keypoints_crowd`. `COCO(..., test_index=[...])` evaluates a keypoint subset.

## Parity and speed

rtmlib RTMPose-WholeBody on 500 COCO val2017 images, COCO-WholeBody v1.0 val:

| iouType | AP | xtcocotools | xthotcoco | max diff |
|---|---:|---:|---:|---:|
| keypoints | 0.721 | 0.468 s | 0.005 s | 7e-16 |
| keypoints_wholebody | 0.649 | 0.774 s | 0.008 s | 6e-16 |
| keypoints_foot | 0.734 | 0.511 s | 0.003 s | 2e-15 |
| keypoints_face | 0.822 | 0.638 s | 0.008 s | 3e-15 |
| keypoints_lefthand | 0.614 | 0.585 s | 0.004 s | 1e-15 |
| keypoints_righthand | 0.601 | 0.561 s | 0.004 s | 1e-15 |

All metrics match xtcocotools to double precision; `tests/` checks this
against xtcocotools when it is installed.

## How it works

The WholeBody/CrowdPose dataset is rewritten into standard COCO keypoints
form (part concatenation, part score, area handling) and passed to
`hotcoco.COCOeval` with per-part `kpt_oks_sigmas`. OKS and AP are computed
in hotcoco.

## License

MIT. Evaluation semantics follow xtcocotools (MIT).
