CoolFace
Datasetpublic

thomasht86/road-images-and-embeddings

Norwegian Road Images with Embeddings (Trondheim Area) A dataset of 34,908 road images from the Trondheim region of Norway (~40km radius), captured by Statens vegvesen (Norwegian Public Roads Administration) in 2025. Each image is paired with rich geospatial metadata, nearest address information, and a 3072-dimensional image embedding from Google's gemini-embedding-2-preview model. Dataset Structure Each example contains: Field Type Description image… See the full description on the dataset page: https://huggingface.co/datasets/thomasht86/road-images-and-embeddings.

sourceHugging Faceotherupdated 6mo agoView on Hugging Face
1likes379downloads
Dataset Card

Norwegian Road Images with Embeddings (Trondheim Area)

A dataset of 34,908 road images from the Trondheim region of Norway (~40km radius), captured by Statens vegvesen (Norwegian Public Roads Administration) in 2025. Each image is paired with rich geospatial metadata, nearest address information, and a 3072-dimensional image embedding from Google's gemini-embedding-2-preview model.

Dataset Description

  • —Source: Vegbilder WFS (OGC WFS 2.0.0)
  • —License: NLOD 2.0 (Norwegian Licence for Open Government Data) - free to use with attribution
  • —Attribution: Statens vegvesen / Norwegian Public Roads Administration
  • —Area: Trondheim, Norway (~40km radius, bbox: 63.07-63.79N, 9.61-11.19E)
  • —Spacing: Images sampled at ~100m intervals along each road segment
  • —Resolution: 4011 x 2018 pixels (planar road camera images)
  • —Embeddings: 3072-dimensional vectors from gemini-embedding-2-preview

Dataset Structure

Each example contains:

FieldTypeDescription
imageImageRoad camera JPEG image (4011x2018)
doc_idstringUnique identifier from Vegbilder
latfloatLatitude (WGS84)
lonfloatLongitude (WGS84)
yearintCapture year (2025)
timestampstringCapture time (ISO 8601)
road_categorystringRoad type: E (European), R (National), F (County)
road_numberintRoad number
road_sectionstringRoad section (e.g., "S2D1")
meterfloatMeter position along road segment
lanestringLane code (1 or 2, indicating direction)
headingfloatCamera heading in degrees
county_numberintNorwegian county number (50 = Trondheim region)
image_typestringCamera type (Planar)
detected_objectsstringAuto-detected objects as JSON (e.g., {"car": "1"})
address_textstringNearest address from Geonorge (e.g., "Innherredsveien 1, 7014 TRONDHEIM, TRONDHEIM")
embeddinglist[float]3072-dim image embedding from gemini-embedding-2-preview

Road Category Distribution

CategoryCountDescription
F (County)31,412County roads
E (European)3,499European highways (e.g., E6, E39)
R (National)183National roads

~82% of images have a resolved nearest address from Geonorge.

Usage

Load the dataset

python
from datasets import load_dataset

ds = load_dataset("thomasht86/road-images-and-embeddings", split="train")

# Access a single example
example = ds[0]
print(example["address_text"])   # "Kvamsveien 72, 7336 MELDAL, ORKLAND"
print(example["image"].size)     # (4011, 2018)
print(len(example["embedding"])) # 3072

Stream the dataset (recommended for large datasets)

python
from datasets import load_dataset

ds = load_dataset("thomasht86/road-images-and-embeddings", split="train", streaming=True)

for example in ds:
    image = example["image"]
    embedding = example["embedding"]
    lat, lon = example["lat"], example["lon"]
    # Process...

Use embeddings for similarity search

python
import numpy as np
from datasets import load_dataset

ds = load_dataset("thomasht86/road-images-and-embeddings", split="train")

# Build embedding matrix
embeddings = np.array(ds["embedding"])  # (34908, 3072)

# Find similar images to the first one
query = embeddings[0]
similarities = embeddings @ query / (np.linalg.norm(embeddings, axis=1) * np.linalg.norm(query))
top_k = np.argsort(similarities)[-5:][::-1]

for idx in top_k:
    print(f"  {ds[int(idx)]['address_text']} (similarity: {similarities[idx]:.3f})")

Filter by location or road type

python
# Only European highways
e_roads = ds.filter(lambda x: x["road_category"] == "E")

# Only images near Trondheim city center
import math
def near_center(example):
    dlat = example["lat"] - 63.43
    dlon = example["lon"] - 10.40
    return math.sqrt(dlat**2 + dlon**2) < 0.05

city_center = ds.filter(near_center)

Data Collection

  1. 1.Image metadata was collected via the Vegbilder WFS endpoint, tiling the bounding box into 0.01-degree chunks
  2. 2.Address enrichment was performed using the Geonorge punktsok API, with coordinate-grid caching at ~100m resolution
  3. 3.Image thinning was applied at 100m minimum spacing along each road segment to reduce redundancy (original dataset: 243,418 images)
  4. 4.Embeddings were generated using Google Gemini Batch API with the gemini-embedding-2-preview multimodal embedding model at 3072 dimensions

Intended Uses

  • —Visual road condition monitoring and analysis
  • —Geospatial image search and retrieval
  • —Multimodal search applications (text-to-image via shared embedding space)
  • —Training and evaluation of road scene understanding models
  • —Urban and infrastructure planning research

Limitations

  • —Images are from 2025 only (single year snapshot)
  • —Coverage is limited to the Trondheim area (~40km radius)
  • —~18% of images lack address information (rural/remote areas)
  • —186 images from the original selection could not be downloaded (0.5%)
  • —Embeddings are from a preview model (gemini-embedding-2-preview) which may change

Citation

If you use this dataset, please credit the original data source:

Statens vegvesen (2025). Vegbilder. Norwegian Public Roads Administration.
Licensed under NLOD 2.0: https://data.norge.no/nlod/en/2.0
thomasht86/road-images-and-embeddings · CoolFace