File size: 4,299 Bytes
f10d4d7
e3c96e2
 
 
f10d4d7
 
 
7c0a22e
 
e3c96e2
f10d4d7
 
 
 
e3c96e2
f10d4d7
e3c96e2
d3445ad
e3c96e2
213f51a
e3c96e2
4f21414
e3c96e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4f21414
f10d4d7
 
e3c96e2
f10d4d7
 
 
e3c96e2
f10d4d7
 
e3c96e2
 
 
f10d4d7
e3c96e2
f10d4d7
e3c96e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
license: apache-2.0
library_name: pytorch
base_model: google/siglip2-base-patch16-224
tags:
- geolocation
- street-view
- transformer
- geoguessr
- nmpz
---

# Street-View Geolocation Transformer (S.V.G.T.)

S.V.G.T. estimates latitude and longitude from street-view images. The SigLIP2 NMPZ model takes one fixed perspective image, ranks geographic cells, and predicts a coordinate within each candidate cell. It uses Google's SigLIP2 Base/16/224 vision encoder with four learned pooling queries and a hierarchical geolocation head.

[Training source and instructions](https://github.com/TheUserWW/S.V.G.T.-StreetViewGeolocationTransformer/tree/df4be555419cec5efce7a8085afd742cfff396c8) · [Upstream SigLIP2](https://huggingface.co/google/siglip2-base-patch16-224) · [Gradio demo](huggingface_demo/README.md)

## Model downloads

Each file is a standalone S.V.G.T. PyTorch checkpoint of approximately 394 MiB. The files include the architecture and preprocessing configuration. Download one checkpoint and select it in a compatible S.V.G.T. client, or pass it to the inference command below.

| Checkpoint | Use |
| --- | --- |
| [SigLIP2 NMPZ, last-block fine-tune](https://huggingface.co/TheUserWW/S.V.G.T.-StreetViewGeolocationTransformer/resolve/main/weights/siglip2-nmpz-last-block.pt) | Default for the Gradio demo. One fixed view and hard geographic labels. |
| [Climate control, weight `0`](https://huggingface.co/TheUserWW/S.V.G.T.-StreetViewGeolocationTransformer/resolve/main/weights/siglip2-nmpz-climate-control.pt) | Frozen encoder and control for the climate experiment. |
| [Climate auxiliary, weight `0.1`](https://huggingface.co/TheUserWW/S.V.G.T.-StreetViewGeolocationTransformer/resolve/main/weights/siglip2-nmpz-climate-aux-0.1.pt) | Experimental Köppen–Geiger supervision with a frozen encoder. |

## Climate experiment

Training labels are the five major climate classes, with 80% raster confidence required. The auxiliary head was trained jointly with geolocation. Predictions use the geographic head. [Beck 1991–2020 climate raster](https://doi.org/10.6084/m9.figshare.21937568.v1)

| Climate loss weight | Top-1 median ↓ | P90 distance ↓ | Within 25 km ↑ | True cell in Top 5 ↑ |
| --- | ---: | ---: | ---: | ---: |
| `0` | 949 km | 3,501 km | 3.64% | 30.55% |
| `0.1` | 1,178 km | 3,602 km | 3.64% | 25.82% |

The two validation-selected checkpoints were evaluated on the same 275 held-out Mapillary images from North and Central America. Both runs used a frozen SigLIP2 encoder, four epochs, seed 1337, and hard geographic labels. At the matched final step (1,100), median distance was 926 km for `0` and 969 km for `0.1`. This is a single regional split with one training seed. The test set had valid climate labels for A, C, and D. The climate loss defaults to `0`.

The sample coverage is regional. These results do not establish global localization accuracy. The [evaluation data](evaluation/climate-ablation.json) include test metrics, support counts, and the raster fingerprint.

## Local inference

From this repository's root, install its inference dependencies and run the CLI with a local checkpoint and one perspective street-view image.

```bash
python -m pip install -r requirements.txt
python -m streetgeo.inference.predict street_view.jpg --checkpoint weights/siglip2-nmpz-last-block.pt --device auto --top-k 5 --json
```

The output contains ranked coordinates, model grid probabilities, and Google Maps links. `--google-coverage-only` enables an optional country and region approximation using the [bundled map sources](assets/maps/un_map_sources.json). The same CLI can load compatible original S.V.G.T. checkpoints with up to four views of one location.

The [bilingual Gradio demo](huggingface_demo/README.md) can run locally or be deployed as a Space. It downloads the default single-view checkpoint on the first prediction. Set `SVGT_CHECKPOINT` to use a local model file instead.

## Licenses

The SigLIP2-derived weights incorporate Google's pretrained vision weights. S.V.G.T. adapts the encoder for geographic localization and fine-tunes the last vision block in the demo checkpoint. The weight files are distributed under [Apache 2.0](LICENSE-SigLIP2). The inference source is covered by the project's [MIT license](LICENSE).