Exemple #1
0
    args = parser.parse_args()

    try:
        args = parser.parse_args()
    except:
        args = parser.parse_known_args()[0]

    net = None
    if args.model == 'ShapeNet32Vox':
        net = model.ShapeNet32Vox()
    elif args.model == 'ShapeNet128Vox':
        net = model.ShapeNet128Vox()
    elif args.model == 'ShapeNetPoints':
        net = model.ShapeNetPoints()
    elif args.model == 'SVR':
        net = model.SVR()

    # dataset = voxelized_data.VoxelizedDataset(
    #    args.mode, voxelized_pointcloud=args.pointcloud, pointcloud_samples=args.pc_samples, res=args.res,
    #    sample_distribution=args.sample_distribution, sample_sigmas=args.sample_sigmas,
    #    num_sample_points=100, batch_size=1, num_workers=0)

    num_sample_points = 100
    sample_distribution = np.array(args.sample_distribution)
    sample_sigmas = np.array(args.sample_sigmas)
    num_samples = np.rint(sample_distribution * num_sample_points).astype(np.uint32)
    data_sample = load_data(args.datapath, args.res, args.pc_samples, num_samples, sample_sigmas,
                            voxelized_pointcloud=args.pointcloud)
    # print('Size of inputs {}'.format(data_sample['inputs'].size()))
    # print('Size of grid_coords {}'.format(data_sample['grid_coords'].size()))
    # print('Size of occupancies {}'.format(data_sample['occupancies'].size()))
Exemple #2
0
DeviceList, MainGPUID = ptUtils.setupGPUs(args.gpu)
print('[ INFO ]: Using {} GPUs with IDs {}'.format(len(DeviceList),
                                                   DeviceList))
Device = ptUtils.setDevice(MainGPUID)
if args.model == 'ShapeNet32Vox':
    net = model.ShapeNet32Vox()

if args.model == 'ShapeNet128Vox':
    net = model.ShapeNet128Vox()

if args.model == 'ShapeNetPoints':
    net = model.ShapeNetPoints()

if args.model == 'SVR':
    net = model.SVR(gpu_idx=MainGPUID)

train_dataset = voxelized_data.VoxelizedDataset(
    'train',
    voxelized_pointcloud=args.pointcloud,
    pointcloud_samples=args.pc_samples,
    data_path=args.input_dir_train,
    res=args.res,
    sample_distribution=args.sample_distribution,
    sample_sigmas=args.sample_sigmas,
    num_sample_points=50000,
    batch_size=args.batch_size,
    num_workers=30)

val_dataset = voxelized_data.VoxelizedDataset(
    'val',