Пример #1
0
    parser.set_defaults(log=False)

    args = parser.parse_args()
    print('Config path: {}'.format(args.config))
    print('Model config path: {}'.format(args.model_config))
    if args.weights is None:
        w = 'RANDOM WEIGHTS'
    else:
        w = args.weights
    print('Weights: {}'.format(w))
    print('Debug mode: {}'.format(args.debug))
    print('Visualize: {}'.format(args.visualize))
    print('Log search results: {}'.format(args.log))
    print('')

    params = MinkLocParams(args.config, args.model_config)
    params.print()

    if torch.cuda.is_available():
        device = "cuda"
    else:
        device = "cpu"
    print('Device: {}'.format(device))

    model = model_factory(params)
    if args.weights is not None:
        assert os.path.exists(
            args.weights), 'Cannot open network weights: {}'.format(
                args.weights)
        print('Loading weights: {}'.format(args.weights))
        model.load_state_dict(torch.load(args.weights, map_location=device))
Пример #2
0
    # Default downsampling factor 1280x960 images to 320x240
    parser.add_argument('--downsample', type=int, default=4, help='Image downsampling factor')

    args = parser.parse_args()
    print('Config path: {}'.format(args.config))
    print('Oxford RobotCar root folder: {}'.format(args.oxford_root))
    print('Camera: {}'.format(args.camera))
    print('Image downsampling factor: {}'.format(args.downsample))

    nn_threshold = 1000  # Nearest neighbour threshold in miliseconds
    k = 20               # Number of nearest neighbour images to find for each LiDAR scan
    ext = '.png'         # Image extension
    print('Number of nearest images for each scan (k): {}'.format(k))
    print('')

    params = MinkLocParams(args.config, model_params_path=None)

    print(f'Parameters from config file: {args.config}')
    print(f"Output folder for downsampled images (image_path): {params.image_path}")
    print(f"Dataset folder (point clouds): {params.dataset_folder}")
    print(f"Evaluation sets - query split: {params.eval_query_files}")
    print(f"Evaluation sets - database split: {params.eval_database_files}")
    print('')

    # Create output path
    out_path = params.image_path
    if not os.path.exists(out_path):
        os.mkdir(out_path)
    assert os.path.exists(out_path), 'Cannot create output directory: {}'.format(out_path)

    # Index LiDAR scans in the dataset