-
Notifications
You must be signed in to change notification settings - Fork 3
/
data_viewer.py
executable file
·30 lines (23 loc) · 1.15 KB
/
data_viewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
import argparse
from rmvd import list_datasets, create_dataset, run_viewer, list_augmentations
def data_viewer(args):
dataset = create_dataset(args.data, augmentations=args.augmentations)
if args.layout is None:
layout_names = dataset.get_layout_names()
if any([layout.startswith("eval") for layout in layout_names]):
layout = [layout for layout in layout_names if layout.startswith("eval")][0]
else:
layout = "default"
else:
layout = args.layout
run_viewer(dataset, layout)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('data', help=f"Data to be viewed. Can either be a path to evaluation outputs, or a dataset"
f"name. Available dataset names are: {', '.join(list_datasets())}")
parser.add_argument('--layout', help=f"Data viewer layout. If not specified, the default layout is used.")
parser.add_argument('--augmentations', nargs='*',
help=f"Data augmentations. Options are: {', '.join(list_augmentations())}")
args = parser.parse_args()
data_viewer(args)