nycLocator-v1
nycLocator-v1 is a visual place-recognition encoder adapted to street-level imagery of New York City. Built on MegaLoc, it produces 8,448-dimensional, L2-normalized descriptors for image retrieval and location matching.
Model specifications
| Property | Value |
|---|---|
| Architecture | MegaLoc with a DINOv2 ViT-B/14 backbone |
| Parameters | 228,639,553 |
| Input | RGB images, resized to 322 × 322 pixels |
| Output | 8,448-dimensional normalized descriptor |
| Weight format | Safetensors, float32 |
| Similarity | Cosine similarity |
Training
The model was initialized from the published MegaLoc weights and adapted from a collection of geotagged New York City street-view images covering 11,864 labeled locations, each with four directional views.
Adaptation uses geographic soft contrastive learning. Nearby locations provide
positive examples; hard negatives are mined from the training descriptors with
a minimum geographic separation of 0.5 km. The final full-data continuation ran
for four epochs using 224-pixel training crops, the last eight transformer blocks
unfrozen, a learning rate of 2e-6, and a geographic temperature of 0.15 km.
The adaptation did not add external reference-image collections, street-map databases, business gazetteers, or public location indexes. The base model's original pretraining is documented separately by its authors. Training images and location labels are not included in this repository.
Evaluation
The initial development phase used a location-level training/validation split with 9,492 training locations and 2,372 validation locations. Hyperparameters and checkpoints were selected using this split. The released checkpoint was then continued on all 11,864 labeled locations, so no held-out evaluation score is assigned to this full-data checkpoint.
Packaging verification includes strict parameter loading, finite-value checks,
normalized descriptor output, exact tensor equality after Safetensors conversion,
and an identical CPU forward pass before and after conversion. Details are
recorded in provenance.json.
Usage
Download the repository while authenticated and install the dependencies:
pip install -r requirements.txt
Run from the downloaded model directory:
import torch
from PIL import Image
from load_model import load_model, preprocess
model = load_model(device="cpu") # Use "cuda" for GPU inference.
image = preprocess(Image.open("street_view.jpg")).unsqueeze(0)
with torch.inference_mode():
descriptor = model(image) # Shape: [1, 8448]
Use the same preprocessing and weights for query and reference images. Compare normalized descriptors with cosine similarity. Geographic predictions require a separate reference collection with known coordinates and a retrieval decoder; the encoder itself does not directly output latitude or longitude.
Files
model.safetensors: adapted encoder weights.megaloc_model.py: pinned upstream architecture implementation.load_model.py: local loading and preprocessing utilities.config.json: architecture and model configuration.training_run.json: training-run metadata.provenance.json: checkpoint integrity and packaging verification.upstream_revision.json: upstream source revision.
Attribution and licensing
MegaLoc was developed by Gabriele Berton and Carlo Masone. Its upstream code is
provided under the MIT license included in LICENSE.MegaLoc. This repository
does not redistribute the training imagery or grant rights to its source data.
Reference: MegaLoc: One Retrieval to Place Them All, CVPR 2025 Workshop. Paper · Upstream implementation
- Downloads last month
- 2
Model tree for ts3915789/nycLocator-v1
Base model
gberton/MegaLoc