This project focuses on visual place recognition and geolocalization using deep learning techniques. It implements and experiments with various models, loss functions, and training strategies to improve the accuracy of place recognition across different datasets and introduces DeMixVPR framework.
To set up the project environment, follow these steps:
-
Clone the repository:
-
Create a virtual environment (optional but recommended):
conda create --name geolocalization --file requirements.txt conda activate geolocalization
The project is organized as follows:
experiments.ipynb
: Main Jupyter notebook for running experimentsmodels/
: Directory containing model architecturesdatasets/
: Custom dataset classes for training and testingutils/
: Utility functions, including custom learning rate schedulerstrain.py
: Training scriptevaluation.py
: Evaluation scriptweights/
: Directory to store trained model weightsdata/
: Directory to store RGB images and depth maps datasets.
To run experiments and train models, use the experiments.ipynb
notebook. This notebook contains various experimental setups and configurations for training and evaluating models.
The project includes several experiments with different configurations. Some of them are:
- Average Pooling + Contrastive Loss
- GEM Pooling + Contrastive Loss
- Batch Hard Miner + Contrastive Loss
- DistanceWeightedMiner + SupConLoss
- PairMargin Miner + FastAP Loss
- MultiSimilarity Loss
Each experiment can be run by setting the TRAIN
variable to True
and executing the corresponding cell in the notebook.
The project uses the following datasets:
- GSVCities-XS Dataset: For training
- SF_XS Dataset: For validation and testing
- Tokyo-XS Dataset: For testing
Dataset loading and preprocessing are handled in the datasets/
directory.
The main model architecture is defined in the models/helper.py
file. It uses a truncated ResNet18 as the backbone with various pooling options (average, GEM).
Model evaluation is performed using the eval_model
function from evaluation.py
. It calculates metrics such as Recall@1 and Recall@5 for the trained models on different test sets.
You can download the pre-trained weights and dataset from the following link: https://drive.google.com/drive/folders/1C7qqH9qhxOm5dKoo6csMS1ldJrPJQzEo?usp=sharing
Report of the project can be found in the repository as report.pdf
.