#!/usr/bin/env python3 # args: base out stage1_cache out_root ds exp views sched_csv batch_size single(0/1) import sys base,out,stage1_cache,out_root,ds,exp,views,sched,bs,single = sys.argv[1:11] txt=open(base).read() idx=txt.index('\nval_appforce:'); head=txt[:idx] sched_list='['+', '.join(sched.split(','))+']' single_yaml = 'true' if str(single) in ('1','true','True') else 'false' block=f""" val_appforce: enabled: true every: 5000 at_step0: false views: {views} schedules: {sched_list} seed: 42 limit: 0 batch_size: {int(bs)} single: {single_yaml} 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} exp: {exp} """ open(out,'w').write(head+block); print("wrote",out,"batch_size",bs,"single",single_yaml)