GeoFinder is an image geolocation prototype using a Vision Transformer + FAISS similarity search.
GeoFinder/
├── src/geofinder/ # Core Python package
│ ├── custom_vit.py
│ ├── extractor.py
│ ├── indexer.py
│ ├── search.py
│ ├── heatmap.py
│ └── train.py
├── scripts/ # CLI entrypoints
│ ├── extractor.py
│ ├── indexer.py
│ ├── search.py
│ ├── heatmap.py
│ └── train.py
├── data/
│ ├── index/ # FAISS index + metadata
│ │ ├── vectors.faiss
│ │ └── metadata.json
│ └── samples/ # Sample/query images
├── models/weights/ # Trained model weights
├── outputs/ # Generated outputs (maps, etc.)
├── dataset/ # Input dataset for indexing/training
├── Dockerfile
├── docker-compose.yml
└── requirements.txt
- Create and activate a virtual environment (recommended).
- Install dependencies:
pip install -r requirements.txtOr using Make:
make installmake index
make search
make heatmapUseful overrides:
make search QUERY_IMAGE=data/samples/query_image.jpg TOP_K=10
make train DATASET=dataset EPOCHS=10 BATCH_SIZE=8python3 scripts/extractor.py data/samples/sample_image.jpgOptional (pretrained backbone):
python3 scripts/extractor.py data/samples/sample_image.jpg --pretrainedpython3 scripts/indexer.py --dataset datasetOptional output locations:
python3 scripts/indexer.py --dataset dataset --out-index data/index/vectors.faiss --out-meta data/index/metadata.jsonpython3 scripts/search.py data/samples/query_image.jpg --top_k 5python3 scripts/heatmap.py data/samples/query_image.jpg --top_k 50 --output-map outputs/output_map.htmlpython3 scripts/train.py --dataset dataset --epochs 5 --batch_size 4 --save_path models/weights/custom_vit_weights.pthBuild and run:
docker compose up --buildThe container default command runs:
python3 scripts/extractor.py- The scripts now use organized default paths under
data/,models/weights/, andoutputs/. - If an image has no GPS EXIF metadata, indexing falls back to random coordinates.
data/index/andoutputs/are created automatically when needed.- Use
make cleanto remove generated FAISS index, map output, and trained weight artifacts.