sleap icon indicating copy to clipboard operation
sleap copied to clipboard

`LabelsConfig.search_path_hints` is populated but not used

Open roomrys opened this issue 2 years ago • 0 comments

Problem Description

Specifying video_search_paths when creating a Trainer via from_config does not use video_search_paths if training_labels argument is of type Labels.

trainer = sleap.nn.training.TopDownMultiClassModelTrainer.from_config(
    cfg, training_labels=labels, video_search_paths=videos

Problem Analysis

I traced where we use video_search_paths when creating a Trainer via from_config and ended up in our DataReaders.from_labels method where I discovered that the video_search_paths are only used if the training_labels argument is a path to an slp (not the already loaded Labels object): https://github.com/talmolab/sleap/blob/833c2d5bdcf4cfef4e0adc7569b8e2245494a8fa/sleap/nn/training.py#L155-L171 and while we update the field in the training config for search_path_hints (if the Labels object is already loaded), https://github.com/talmolab/sleap/blob/833c2d5bdcf4cfef4e0adc7569b8e2245494a8fa/sleap/nn/training.py#L132-L142 I cannot seem to find where we actually use this pretty useful search_path_hints field.

Originally posted by @roomrys in https://github.com/talmolab/sleap/discussions/1120#discussioncomment-4845642

roomrys avatar Feb 01 '23 22:02 roomrys