TransGeo: Transformer Is All You Need for Cross-view Image Geo-localization

repository·main·Indexed 41 days ago

https://github.com/jeff-zilence/transgeo2022

An implementation of the TransGeo method for cross-view image geo-localization using Vision Transformers. Supports VIGOR, CVUSA, and CVACT datasets, requiring Python >= 3.6 and PyTorch >= 1.8.1.

Tokens
480
Snippets
1
Records
4
Agent score
1%

What's inside TransGeo

  1. Train and evaluate TransGeo2022 models

    main

    Training and evaluation are performed using shell scripts and the train.py script.

    Running training scripts

    Execute the provided shell scripts for specific datasets, for example:

    sh run_CVUSA.sh

    Configuring train.py

    • Dataset selection: Change the --dataset flag to train on different datasets.
    • GPU configuration: Specify GPUs directly in train.py. The code uses a multiprocessing distributed training style (similar to PyTorch and Moco) but defaults to using only one GPU.
    • Stage-1 training: To train the simple stage-1 model, remove the second line in the training script.
    • Multi-GPU training: If using multiple GPUs, you may need to tune the learning rate (e.g., using the linear scaling rule). Note that using too many GPUs with the provided sampler may cause memory issues.
    • Evaluation with pretrained weights: To evaluate using pretrained weights instead of training from scratch, add the -e flag to train.py.
    sh run_CVUSA.sh
    # Or using train.py directly for evaluation:
    python train.py -e --dataset <dataset_name>
  2. Access pretrained models

    main
    Pretrained models are available via Google Drive. For meter-level evaluation on the VIGOR dataset, you can use the provided validation features (available in .npy format) for quick evaluation. For full meter-level evaluation code, refer to the VIGOR repository.