Skip to content

Bug: Hardcoded path parsing in get_multisession_dataloader ignores ChunkDataset.data_key #153

@VaibhavGarg2003

Description

@VaibhavGarg2003

While going through dataloaders.py, I noticed that get_multisession_dataloader() uses hardcoded string splitting to derive dataset_name:

TODO use saved meta dict to find data key#
if "dynamic" in path:
dataset_name = path.split("dynamic")[1].split("-Video")[0]
elif "_gaze" in path:
dataset_name = path.split("gaze")[0].split("datasets/")[1]
else:
dataset_name = f"session
{i}"

I think it assumes specific directory naming conventions and uses a hardcoded "datasets/" separator that breaks on Windows or non standard folder structures. There's also a TODO comment acknowledging this should use the meta dict instead.
Interestingly,
get_multisession_concat_dataloader() right below it already solves this correctly by using dataset.data_key (line 169), which pulls from meta.json with proper fallbacks.
The fix would be to remove the if/elif/else block and just use dataset.data_key after creating the ChunkDataset, consistent with how the concat variant already works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions