-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.py
executable file
·63 lines (51 loc) · 4 KB
/
config.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
import argparse
def load_args():
parser = argparse.ArgumentParser(description='Dimension estimation')
# saving, debuging, and configs
parser.add_argument('--save_dir', default='dim_outputs', help="dataset to use for dim estimation")
parser.add_argument('--random_seed', type=int, default=1)
parser.add_argument('--stylized_data_dir',
default='/local/data1/mkowal/data/stylized_datasets/val_stylized_Diving48',
help="Path to stylized dataset directory and json files")
parser.add_argument('--cfg_file', default='configs/twostreamv3plus_davis.json')
# data
parser.add_argument('--dataset', default='Diving48',
help="dataset to use for dim estimation (StylizedActivityNet | ssv2 | Diving48)")
parser.add_argument('--app_shuffle', default=True, help="shuffle the appearance pair frames")
parser.add_argument('--use_normal_app', default=False, help="use normal videos for the appearance pair frames")
parser.add_argument('--m_same', default=True, help="Use same video for motion pair")
# model
parser.add_argument('--model', default='slow_r50_8x8', help="model to do dimension estimation on")
parser.add_argument('--stg', default=None, help="stage of network to analyze")
parser.add_argument('--path', default='fast', help="Slowfast path to use (cat | slow | fast)")
parser.add_argument('--fuse', default=True, help="Slowfast to fuse before returning midlayer")
parser.add_argument('--gp', default=None, type=str, metavar='POOL',
help='Global pool type, one of (fast, avg, max, avgmax, avgmaxc). Model default if None.')
parser.add_argument('--trained_on', default='davis', type=str)
# custom evaluation parameters
parser.add_argument('--checkpoint', default='', help="path to checkpoint")
parser.add_argument('--stage', default=5, type=int, help="stage or layer to perform estimation on")
# dim estimation
parser.add_argument('--n_factors', default=3, help="number of factors (including residual)")
parser.add_argument('--styles', default='1,2,3,4', help="ids of styles")
parser.add_argument('--residual_index', default=2, help="index of residual factor (usually last)")
parser.add_argument('--joint_encoding', default=False, type=bool,
help="Present figure of motion-appearance joint encoding neurons")
parser.add_argument('--joint_encoding_thresh', default=0.5,
help="Thrershold of motion-appearance joint encoding neurons")
# data loading details
parser.add_argument('--batch_size', default=2, help="batch size during evaluation")
parser.add_argument('--image_size', default=256, help="image size during evaluation")
parser.add_argument('--n_sample_frames', default=64, help="number of frames to sample from video during training")
parser.add_argument('--n_examples', default=3000,
help="number of examples to use for estimation, should lower this if you run out of memory")
# validation params
parser.add_argument('--torchscript', dest='torchscript', action='store_true',
help='convert model torchscript for inference')
# computing
parser.add_argument('--device', default=0, type=int, help="gpu id")
parser.add_argument('--num_workers', default=4, type=int, help="number of CPU threads")
args = parser.parse_args()
return args
# CUDA_VISIBLE_DEVICES=0 python main.py --model slow_r50_8x8 --checkpoint /local/data1/mkowal/projects/dim_estimation/models/ar_models/checkpoints/slowonly_8x8_2gpu_run2/checkpoints/checkpoint_epoch_00100.pyth --stylized_data_dir /local/data1/mkowal/data/stylized_datasets/val_stylized_Diving48 --dataset Diving48
# CUDA_VISIBLE_DEVICES=1 python main.py --model fast --checkpoint /local/data1/mkowal/projects/dim_estimation/models/ar_models/checkpoints/fastonly_ssv2_4gpu_run1/checkpoints/checkpoint_epoch_00040.pyth --stylized_data_dir /local/data1/mkowal/data/stylized_datasets/stylized_ssv2 --dataset ssv2