Add support for starting syn data generation from specific point

master
CptCaptain 3 years ago
parent 4617525f61
commit 42599ee465
  1. 2
      create_syn_data.sh
  2. 12
      data/create_syn_data.py

@ -4,4 +4,4 @@ cd data/lcn
python setup.py build_ext --inplace python setup.py build_ext --inplace
cd ../ cd ../
python create_syn_data.py python create_syn_data.py $2

@ -218,6 +218,16 @@ if __name__=='__main__':
out_root = data_root / f'{data_type}' out_root = data_root / f'{data_type}'
out_root.mkdir(parents=True, exist_ok=True) out_root.mkdir(parents=True, exist_ok=True)
start = 0
if len(sys.argv) >= 2 and isinstance(sys.argv[2], int):
start = sys.argv[2]
else:
if sys.argv[2] == '--resume':
try:
start = max([int(dir) for dir in os.listdir(out_root) if str.isdigit(dir)]) or 0
except:
pass
# load shapenet models # load shapenet models
obj_classes = ['chair'] obj_classes = ['chair']
objs = get_objs(shapenet_root, obj_classes) objs = get_objs(shapenet_root, obj_classes)
@ -254,6 +264,6 @@ if __name__=='__main__':
# start the job # start the job
n_samples = 2**10 + 2**13 n_samples = 2**10 + 2**13
for idx in range(n_samples): for idx in range(start, n_samples):
args = (out_root, idx, n_samples, imsize, patterns, K, baseline, blend_im, noise, track_length) args = (out_root, idx, n_samples, imsize, patterns, K, baseline, blend_im, noise, track_length)
create_data(*args) create_data(*args)

Loading…
Cancel
Save