def main(): expr_code = 'V00_release' cwd = os.getcwd() default_cfg_path = cwd + '/../configs/grabnet_cfg.yaml' base_dir = '/is/ps2/otaheri/grab_net/experiments/GrabNet_release' work_dir = os.path.join(base_dir, expr_code) processed_data_path = '/ps/scratch/grab/contact_results/omid_46/GrabNet/data' cfg = { 'n_neurons': 512, 'batch_size': 256, 'n_workers': 10, 'cuda_id': 0, 'use_multigpu': False, 'latentD': 16, 'kl_coef': 5e-3, 'in_features': 4096, 'rhm_path': '/ps/scratch/grab/body_models/models/mano/MANO_RIGHT.pkl', 'vpe_path': cwd + '/../configs/verts_per_edge.npy', 'c_weights_path': cwd + '/../configs/rhand_weight.npy', 'reg_coef': 5e-4, 'base_lr': 5e-4, 'best_cnet': None, 'best_rnet': None, 'log_every_epoch': 2, 'expr_code': expr_code, 'work_dir': work_dir, 'n_epochs': 500, 'dataset_dir': processed_data_path, 'load_on_ram': True } cfg = Config(default_cfg_path=default_cfg_path, **cfg) grab_trainer = Trainer(cfg=cfg) grab_trainer.fit()
vpe_path = 'grabnet/configs/verts_per_edge.npy' c_weights_path = 'grabnet/configs/rhand_weight.npy' cfg = { 'batch_size': batch_size, 'n_workers': n_workers, 'use_multigpu': multi_gpu, 'kl_coef': kl_coef, 'dataset_dir': data_path, 'rhm_path': rhm_path, 'vpe_path': vpe_path, 'c_weights_path': c_weights_path, 'expr_ID': expr_ID, 'work_dir': work_dir, 'base_lr': base_lr, 'best_cnet': None, 'best_rnet': None, 'load_on_ram': load_on_ram } cfg = Config(default_cfg_path=default_cfg_path, **cfg) grabnet_trainer = Trainer(cfg=cfg) grabnet_trainer.fit() cfg = grabnet_trainer.cfg cfg.write_cfg( os.path.join( work_dir, 'TR%02d_%s' % (cfg.try_num, os.path.basename(default_cfg_path))))
help='number of grasps to generate') args = parser.parse_args() obj_path = args.obj_path rhm_path = args.rhm_path scale = args.scale n_samples = args.n_samples cwd = os.getcwd() work_dir = cwd + '/logs' best_cnet = 'grabnet/models/coarsenet.pt' best_rnet = 'grabnet/models/refinenet.pt' bps_dir = 'grabnet/configs/bps.npz' config = { 'work_dir': work_dir, 'best_cnet': best_cnet, 'best_rnet': best_rnet, 'bps_dir': bps_dir, 'rhm_path': rhm_path } cfg = Config(**config) grabnet = Tester(cfg=cfg) grab_new_objs(grabnet, obj_path, rot=True, n_samples=n_samples, scale=scale)
args = parser.parse_args() rhm_path = args.rhm_path cwd = os.getcwd() work_dir = cwd + '/logs' best_cnet = 'grabnet/models/coarsenet.pt' best_rnet = 'grabnet/models/refinenet.pt' bps_dir = 'grabnet/configs/bps.npz' cfg_path = 'grabnet/configs/grabnet_cfg.yaml' config = { 'work_dir': work_dir, 'best_cnet': best_cnet, 'best_rnet': best_rnet, 'bps_dir': bps_dir, 'rhm_path': rhm_path } cfg = Config(default_cfg_path=cfg_path, **config) grabnet = Tester(cfg=cfg) print('Setting refineNet iters', args.iters) grabnet.refine_net.n_iters = args.iters grab_new_objs(grabnet, pkl_path, rot=True, n_samples=1)