Guides

Annotating data

DeepPoseKit ships with an interactive annotation tool for marking user-defined keypoints on still images or video frames.

Define your skeleton

Start by listing your keypoints (e.g. head, thorax,abdomen, left_wing, right_wing) and the parent–child relationships that form your skeleton graph. Skeletons are described in a small CSV file.

name,parent
head,thorax
thorax,
abdomen,thorax
left_wing,thorax
right_wing,thorax

Create an annotation set

from deepposekit.io import initialize_dataset

initialize_dataset(
    images='/path/to/images',
    datapath='/path/to/annotation_data.h5',
    skeleton='/path/to/skeleton.csv',
    overwrite=False,
)

Annotate keypoints

Launch the annotator on the HDF5 file you just created. The tool lets you click each keypoint, copy keypoints across consecutive frames, and mark frames as “reviewed”.

from deepposekit.annotate import Annotator

app = Annotator(
    datapath='/path/to/annotation_data.h5',
    dataset='images',
    skeleton='/path/to/skeleton.csv',
    shuffle_colors=False,
)
app.run()

Tips

  • Start with 100–200 diverse frames and grow the set iteratively.
  • Include the corner cases you expect to see at inference time.
  • Use video frames sampled at varied time points rather than consecutive frames.