forked from Stanford-TML/EDGE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
args.py
98 lines (93 loc) · 3.15 KB
/
args.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import argparse
def parse_train_opt():
parser = argparse.ArgumentParser()
parser.add_argument("--project", default="runs/train", help="project/name")
parser.add_argument("--exp_name", default="exp", help="save to project/name")
parser.add_argument("--data_path", type=str, default="data/", help="raw data path")
parser.add_argument(
"--processed_data_dir",
type=str,
default="data/dataset_backups/",
help="Dataset backup path",
)
parser.add_argument(
"--render_dir", type=str, default="renders/", help="Sample render path"
)
parser.add_argument("--feature_type", type=str, default="jukebox")
parser.add_argument(
"--wandb_pj_name", type=str, default="EDGE", help="project name"
)
parser.add_argument("--batch_size", type=int, default=64, help="batch size")
parser.add_argument("--epochs", type=int, default=2000)
parser.add_argument(
"--force_reload", action="store_true", help="force reloads the datasets"
)
parser.add_argument(
"--no_cache", action="store_true", help="don't reuse / cache loaded dataset"
)
parser.add_argument(
"--save_interval",
type=int,
default=100,
help='Log model after every "save_period" epoch',
)
parser.add_argument("--ema_interval", type=int, default=1, help="ema every x steps")
parser.add_argument(
"--checkpoint", type=str, default="", help="trained checkpoint path (optional)"
)
opt = parser.parse_args()
return opt
def parse_test_opt():
parser = argparse.ArgumentParser()
parser.add_argument("--feature_type", type=str, default="jukebox")
parser.add_argument("--out_length", type=float, default=30, help="max. length of output, in seconds")
parser.add_argument(
"--processed_data_dir",
type=str,
default="data/dataset_backups/",
help="Dataset backup path",
)
parser.add_argument(
"--render_dir", type=str, default="renders/", help="Sample render path"
)
parser.add_argument(
"--checkpoint", type=str, default="checkpoint.pt", help="checkpoint"
)
parser.add_argument(
"--music_dir",
type=str,
default="data/test/wavs",
help="folder containing input music",
)
parser.add_argument(
"--save_motions", action="store_true", help="Saves the motions for evaluation"
)
parser.add_argument(
"--motion_save_dir",
type=str,
default="eval/motions",
help="Where to save the motions",
)
parser.add_argument(
"--cache_features",
action="store_true",
help="Save the jukebox features for later reuse",
)
parser.add_argument(
"--no_render",
action="store_true",
help="Don't render the video",
)
parser.add_argument(
"--use_cached_features",
action="store_true",
help="Use precomputed features instead of music folder",
)
parser.add_argument(
"--feature_cache_dir",
type=str,
default="cached_features/",
help="Where to save/load the features",
)
opt = parser.parse_args()
return opt