Migrating from talmolab/sleap#734 since DLC I/O now lives in sleap-io
(sleap_io/io/dlc.py).
Current DLC import (load_dlc) reads CSV-based annotations into Labels, but
several pieces of DLC project metadata are still missing for a complete import:
-
Training set splits: DLC stores train/val/test splits in
Documentation_data-*.pickle (and related metadata files). sleap-io
doesn't currently surface these — they'd map most naturally to a future
per-frame split annotation or to a sidecar config consumed by sleap-nn.
-
Cropping / ROI: DLC supports ROI cropping during labeling/training.
sleap-io has no ROI primitive yet, so this is blocked on adding ROI
support to the data model.
-
Link single images back to original videos: DLC exports labeled
frames as folders of images under labeled-data/<video_name>/. Today
sleap-io creates a Video.from_filename(image_files) per folder; it
could additionally parse the DLC config.yaml (which lists
video_sets) to point back to the original .mp4/.avi files when
available.
-
Skeleton edges: _parse_multi_animal_structure and
_parse_single_animal_structure (sleap_io/io/dlc.py:196-257) only
build Skeleton(nodes=...) and never populate edges. DLC's
config.yaml defines skeleton: as a list of edges — these should be
parsed and added to the imported Skeleton.
Originally filed as talmolab/sleap#734 (2022). Related: talmolab/sleap#606.
This will likely be broken down into separate PRs / sub-tasks per item.
Migrating from talmolab/sleap#734 since DLC I/O now lives in sleap-io
(
sleap_io/io/dlc.py).Current DLC import (
load_dlc) reads CSV-based annotations intoLabels, butseveral pieces of DLC project metadata are still missing for a complete import:
Training set splits: DLC stores train/val/test splits in
Documentation_data-*.pickle(and related metadata files). sleap-iodoesn't currently surface these — they'd map most naturally to a future
per-frame split annotation or to a sidecar config consumed by sleap-nn.
Cropping / ROI: DLC supports ROI cropping during labeling/training.
sleap-io has no ROI primitive yet, so this is blocked on adding ROI
support to the data model.
Link single images back to original videos: DLC exports labeled
frames as folders of images under
labeled-data/<video_name>/. Todaysleap-io creates a
Video.from_filename(image_files)per folder; itcould additionally parse the DLC
config.yaml(which listsvideo_sets) to point back to the original.mp4/.avifiles whenavailable.
Skeleton edges:
_parse_multi_animal_structureand_parse_single_animal_structure(sleap_io/io/dlc.py:196-257) onlybuild
Skeleton(nodes=...)and never populate edges. DLC'sconfig.yamldefinesskeleton:as a list of edges — these should beparsed and added to the imported
Skeleton.Originally filed as talmolab/sleap#734 (2022). Related: talmolab/sleap#606.
This will likely be broken down into separate PRs / sub-tasks per item.