Registry / ai-ml / xtcocotools

xtcocotools

JSON →
library1.14.3pypypiunverified

Extended COCO API (xtcocotools) is a fork of the original COCO API with enhanced functionality for keypoint detection and human pose estimation. Current version: 1.14.3. Release cadence is irregular, primarily updated for bug fixes and compatibility improvements.

pip install xtcocotools
INSTALL
IMPORT
SIG · XTCOCOTOOLS
X
xtcocotools
ai-mlpythonv1.14.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

COCO
✓ from xtcocotools.coco import COCO
✗ from pycocotools.coco import COCO
xtcocotools is a fork; mixing imports from pycocotools leads to version mismatch or missing keypoint methods.
COCOeval
✓ from xtcocotools.cocoeval import COCOeval
COCOkeypointAPI
✓ from xtcocotools.coco import COCOkeypointAPI
mask
✓ from xtcocotools import mask as maskUtils
✗ from pycocotools import mask
Same as above - namespace conflict.

Quick start: load a COCO keypoint annotation file and list image IDs for the 'person' category.

from xtcocotools.coco import COCO from xtcocotools.cocoeval import COCOeval # Initialize COCO API for keypoint annotations coco = COCO('annotations/person_keypoints_train2017.json') # Get category IDs cat_ids = coco.getCatIds(catNms=['person']) img_ids = coco.getImgIds(catIds=cat_ids) print(f'Found {len(img_ids)} images')
Debug
Known issues
breakingDo not install pycocotools alongside xtcocotools. Both share the same top-level module name in compiled extensions, causing cryptic crashes like ImportError or undefined symbols.
fix
Uninstall pycocotools: pip uninstall pycocotools -y; then install xtcocotools.
affects: all
gotchaThe COCO API uses .pyd files on Windows or .so on Linux; if you build from source, ensure you have Cython and a C++ compiler installed. Pre-built wheels may not be available for all platforms.
fix
Install via conda if available, or use a precompiled wheel from PyPI with Python 3.6+.
affects: >=1.0
deprecatedxtcocotools.coco.COCOkeypointAPI is deprecated in newer versions. Use COCO methods directly or migrate to the standard COCOeval keypoint evaluation.
fix
Use COCO() object and COCOeval() with iouType='keypoints' instead.
affects: >=1.12
Upgrade
Version history
1.14.3latest on PyPI · released Oct 19, 2023
Audit
Dependencies
pycocotoolsrequiredConflict in namespace: installing both pycocotools and xtcocotools can cause import errors due to overlapping .pyd files.
CythonoptionalRequired for building from source if no pre-built wheel is available.
numpyrequiredCore dependency for array operations.
Agent activity
40 hits · last 30 days
node
34
Anthropic
1
OpenAI (training)
1
Resources
xtcocotools — pip install xtcocotools · libregistry