Horse anatomy keypoints (prototype models)
Three models (two DeepLabCut 3, one YOLO-pose) that find 15 anatomical points on a horse photographed from the side. Made by team 23 for the project Rozpoznávanie anatómie koňa na videu (FEI TUKE).
| folder | model | initial weights | test error* |
|---|---|---|---|
dlc-resnet/ | ResNet-50 | ImageNet | 10.5 px |
dlc-hrnet/ | HRNet-w32 | SuperAnimal-Quadruped backbone | 13.6 px |
yolo/ | YOLO11n-pose (Ultralytics) | COCO-pose yolo11n-pose.pt | see below |
* mean keypoint error on 21 held-out photos at 1020 px image width (≈4× on the original 4080 px photos). The best epoch was picked on the same photos, so the numbers are slightly optimistic.
Each DeepLabCut folder holds pytorch_config.yaml and one snapshot-best-*.pt; yolo/ holds best.pt (trained at 512 px).
On the same 21 photos 40 % of YOLO keypoints are within 10 % of the withers–tuber_coxae distance (DeepLabCut: ~83 %), but YOLO finds the whole horse more reliably on photos from other places. YOLO may have seen some of these photos in training.
Keypoints
In this order: withers, shoulder_joint, elbow, carpus, front_fetlock, tuber_coxae, hip_joint,
tuber_ischii, stifle, hock, hind_fetlock, hoof_left_front, hoof_right_front, hoof_right_hind, hoof_left_hind.
The leg joints are on the side of the horse facing the camera, the hooves are named by their anatomical side.
Training data
107 photos (4080×2296, downscaled ×0.25 to 1020 px for training), single horse, side view, 86 train / 21 test, 200 epochs. All photos come from one location (same wall, ground and handlers).
Limitations
- Works well on photos similar to the training ones (side view, whole horse in frame, good resolution).
- On other backgrounds, small images, angled views and moving horses (video) the DeepLabCut models find few points; HRNet finds more than ResNet, YOLO finds the most but less precisely. More diverse data is the next step.
- Left/right hoof labels in the training data are not fully consistent, so the models sometimes swap hooves.
YOLO is used through ultralytics, which is AGPL-3.0 licensed.
Usage
from deeplabcut.pose_estimation_pytorch.apis.utils import get_pose_inference_runner
from huggingface_hub import snapshot_download
path = snapshot_download("team23-horse/horse-anatomy-dlc", revision="v1")
runner = get_pose_inference_runner(f"{path}/dlc-resnet/pytorch_config.yaml",
snapshot_path=f"{path}/dlc-resnet/snapshot-best-120.pt",
device="cpu", max_individuals=1)
# image: RGB numpy array resized to 1020 px width
keypoints = runner.inference([image])[0]["bodyparts"][0] # (15, 3): x, y, confidence
Versions
v1: DeepLabCut models.v2: + YOLO-pose (yolo/best.pt).