-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpaths.py
More file actions
72 lines (60 loc) · 2.13 KB
/
paths.py
File metadata and controls
72 lines (60 loc) · 2.13 KB
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
from __future__ import annotations
from pathlib import Path
import argparse
root = Path(__file__).resolve().parent
WEIGHTS_ROOT = root / 'weights'
DATASETS_ROOT = root / 'datasets'
OUTPUT_ROOT = root / 'outputs'
ANNO_ROOT = root / 'annotations'
CKPT_MASK3D = WEIGHTS_ROOT / 'mask3d' / 'scannet200_val.ckpt'
CKPT_UNI3D = WEIGHTS_ROOT / 'uni3d' / 'uni3d_g.pth'
CKPT_CLIP_EVA02 = WEIGHTS_ROOT / 'open_clip' / 'EVA02-E-14-plus' / 'open_clip_pytorch_model.bin'
TIMM_EVA_GIANT = WEIGHTS_ROOT / 'timm' / 'eva_giant_patch14_560.m30m_ft_in22k_in1k' / 'model.safetensors'
CKPT_SAM = WEIGHTS_ROOT / 'sam' / 'sam_vit_h_4b8939.pth'
CKPT_CLIP336 = WEIGHTS_ROOT / 'clip' / 'clip-vit-large-patch14-336'
CKPT_VICUNA = WEIGHTS_ROOT / 'llm' / 'vicuna-7b-v1.5'
SCANS_PATH = DATASETS_ROOT / 'scannetv2_frames'
SCANNET_PROC = DATASETS_ROOT / 'scannet200_processed'
MASKS_DIR = OUTPUT_ROOT / '3d_masks'
FEATS3D_DIR = OUTPUT_ROOT / '3d_feats'
FEATS2D_DIR = OUTPUT_ROOT / '2d_feats'
def _mk_dirs() -> None:
dirs = [
WEIGHTS_ROOT,
DATASETS_ROOT,
OUTPUT_ROOT,
ANNO_ROOT,
MASKS_DIR,
FEATS3D_DIR,
FEATS2D_DIR,
SCANS_PATH,
SCANNET_PROC,
CKPT_MASK3D.parent,
CKPT_UNI3D.parent,
CKPT_CLIP_EVA02.parent,
TIMM_EVA_GIANT.parent,
CKPT_SAM.parent,
CKPT_CLIP336,
CKPT_VICUNA,
]
for p in dirs:
Path(p).mkdir(parents=True, exist_ok=True)
def _print() -> None:
for name in [
'SCANS_PATH','SCANNET_PROC','CKPT_MASK3D','CKPT_UNI3D','CKPT_CLIP_EVA02',
'TIMM_EVA_GIANT','CKPT_SAM','CKPT_CLIP336','CKPT_VICUNA','MASKS_DIR',
'FEATS3D_DIR','FEATS2D_DIR','ANNO_ROOT','OUTPUT_ROOT'
]:
value = globals()[name]
print(f"{name}={value.resolve()}")
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument('--mk', action='store_true', help='create folder structure')
parser.add_argument('--print', dest='dump', action='store_true', help='print all paths')
args = parser.parse_args()
if args.mk:
_mk_dirs()
if args.dump:
_print()
if __name__ == '__main__':
main()