Skip to content

Commit

Permalink
add run_worker.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel03c1 committed Nov 11, 2022
1 parent 1e20391 commit 6727731
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions TensoRF/run_worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import argparse
import glob
import os

parser = argparse.ArgumentParser()
parser.add_argument('--gpu', required=True, type=str)
parser.add_argument('--dataset', required=True, type=str)
parser.add_argument('--dwt_level', type=int, default=4)
parser.add_argument('--trans_func', type=str, default='bior4.4')


if __name__ == '__main__':
args = parser.parse_args()
print(str(vars(args)))

datadirs = {'nerf': ['../../nerf_synthetic/chair',
'../../nerf_synthetic/drums',
'../../nerf_synthetic/ficus',
'../../nerf_synthetic/hotdog',
'../../nerf_synthetic/lego',
'../../nerf_synthetic/materials',
'../../nerf_synthetic/mic',
'../../nerf_synthetic/ship'],
'nsvf': ['../../Synthetic_NSVF/Bike',
'../../Synthetic_NSVF/Lifestyle',
'../../Synthetic_NSVF/Palace',
'../../Synthetic_NSVF/Robot',
'../../Synthetic_NSVF/Spaceship',
'../../Synthetic_NSVF/Steamtrain',
'../../Synthetic_NSVF/Toad',
'../../Synthetic_NSVF/Wineholder'],
'tank': ['../../TanksAndTemple/Barn',
'../../TanksAndTemple/Caterpillar',
# '../../TanksAndTemple/Family',
'../../TanksAndTemple/Ignatius',
'../../TanksAndTemple/Truck']}
dataset_names = {'nerf': 'blender',
'nsvf': 'nsvf',
'tank': 'tankstemple'}

args.dataset = args.dataset.lower()

for datadir in datadirs[args.dataset]:
for mw in [2e-10]: # , 5e-11]:
name = f'{args.dataset}_{datadir.split("/")[-1]}_{mw}_{args.dwt_level}_{args.trans_func}'
os.system(f'CUDA_VISIBLE_DEVICES={args.gpu} python3 train.py '
f'--use_mask --mask_weight={mw} --config=configs/default.txt '
f'--use_dwt --dwt_level={args.dwt_level} --datadir={datadir} '
f'--grid_bit=8 --trans_func={args.trans_func} '
f'--expname={name} --dataset_name={dataset_names[args.dataset]}')

0 comments on commit 6727731

Please sign in to comment.