MCPcopy
hub / github.com/magicleap/Atlas / parse_splits_list

Function parse_splits_list

atlas/data.py:270–288  ·  view source on GitHub ↗

Returns a list of info_file paths Args: splits (list of strings): each item is a path to a .json file or a path to a .txt file containing a list of paths to .json's.

(splits)

Source from the content-addressed store, hash-verified

268
269
270def parse_splits_list(splits):
271 """ Returns a list of info_file paths
272 Args:
273 splits (list of strings): each item is a path to a .json file
274 or a path to a .txt file containing a list of paths to .json's.
275 """
276
277 if isinstance(splits, str):
278 splits = splits.split()
279 info_files = []
280 for split in splits:
281 ext = os.path.splitext(split)[1]
282 if ext=='.json':
283 info_files.append(split)
284 elif ext=='.txt':
285 info_files += [info_file.rstrip() for info_file in open(split, 'r')]
286 else:
287 raise NotImplementedError('%s not a valid info_file type'%split)
288 return info_files
289
290

Callers 6

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
train_dataloaderMethod · 0.90
val_dataloaderMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected