MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / get_all_sequences

Function get_all_sequences

eval_code/recons/utils/files.py:8–17  ·  view source on GitHub ↗
(dataset_cfg: DictConfig, sort_by_seq_name: bool = True)

Source from the content-addressed store, hash-verified

6
7
8def get_all_sequences(dataset_cfg: DictConfig, sort_by_seq_name: bool = True):
9 if isinstance(dataset_cfg.ls_all_seqs, str):
10 # if ls_all_seqs is a string, it is the root path of sequences
11 seq_list = [d for d in os.listdir(dataset_cfg.ls_all_seqs) if osp.isdir(osp.join(dataset_cfg.ls_all_seqs, d))]
12 elif isinstance(dataset_cfg.ls_all_seqs, ListConfig):
13 # if ls_all_seqs is a ListConfig, it is the ListConfig of sequence names
14 seq_list = dataset_cfg.ls_all_seqs
15 else:
16 raise ValueError(f"Unknown ls_all_seqs type: {type(dataset_cfg.ls_all_seqs)}, ls_all_seqs is {dataset_cfg.ls_all_seqs}, which should be a string or a ListConfig")
17 return sorted(seq_list) if sort_by_seq_name else seq_list
18
19def list_imgs_a_sequence(dataset_cfg: DictConfig, seq: Optional[str] = None):
20 subdir = dataset_cfg.img.path.format(seq=seq) # string include {seq}

Callers 8

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected