File size: 835 Bytes
4c3d957 | 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 | #!/usr/bin/env python3
import sys,re
# args: base_config out_config stage1_cache out_root ds_name exp views schedules_csv
base,out,stage1_cache,out_root,ds_name,exp,views,sched = sys.argv[1:9]
txt=open(base).read()
# cut everything from 'val_appforce:' to EOF, replace with our block
idx=txt.index('\nval_appforce:')
head=txt[:idx]
sched_list='['+', '.join(sched.split(','))+']'
block=f"""
val_appforce:
enabled: true
every: 5000
at_step0: false
views: {views}
schedules: {sched_list}
seed: 42
limit: 0
batch_size: 6
single: true
decode_procs: 1
ref_threads: 8
stage1_cache: {stage1_cache}
out_root: {out_root}
ref_python: /lp-dev/jonghoon/mv-mesh/envs/mv-sam3d/bin/python
eval_dataset_flag: toys4k
datasets:
- name: {ds_name}
exp: {exp}
"""
open(out,'w').write(head+block)
print("wrote",out)
|