thomasht86/road-images-and-embeddings
收藏Hugging Face2026-03-21 更新2026-03-29 收录
下载链接:
https://hf-mirror.com/datasets/thomasht86/road-images-and-embeddings
下载链接
链接失效反馈官方服务:
资源简介:
---
license: other
license_name: nlod-2.0
license_link: https://data.norge.no/nlod/en/2.0
language:
- "no"
tags:
- road-images
- norway
- trondheim
- vegbilder
- embeddings
- multimodal
- geospatial
- gemini
pretty_name: Norwegian Road Images with Embeddings (Trondheim Area)
size_categories:
- 10K<n<100K
task_categories:
- image-feature-extraction
- image-classification
- zero-shot-image-classification
configs:
- config_name: default
data_files:
- split: train
path: data/train/**
dataset_info:
- config_name: default
features:
- name: image
dtype: image
- name: doc_id
dtype: string
- name: lat
dtype: float64
- name: lon
dtype: float64
- name: year
dtype: int64
- name: timestamp
dtype: string
- name: road_category
dtype: string
- name: road_number
dtype: int64
- name: road_section
dtype: string
- name: meter
dtype: float64
- name: lane
dtype: string
- name: heading
dtype: float64
- name: county_number
dtype: int64
- name: image_type
dtype: string
- name: detected_objects
dtype: string
- name: address_text
dtype: string
- name: embedding
sequence: float32
splits:
- name: train
num_examples: 34908
---
# 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](https://www.vegvesen.no/) (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](https://vegbilder.atlas.vegvesen.no/) (OGC WFS 2.0.0)
- **License**: [NLOD 2.0](https://data.norge.no/nlod/en/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:
| Field | Type | Description |
|---|---|---|
| `image` | Image | Road camera JPEG image (4011x2018) |
| `doc_id` | string | Unique identifier from Vegbilder |
| `lat` | float | Latitude (WGS84) |
| `lon` | float | Longitude (WGS84) |
| `year` | int | Capture year (2025) |
| `timestamp` | string | Capture time (ISO 8601) |
| `road_category` | string | Road type: E (European), R (National), F (County) |
| `road_number` | int | Road number |
| `road_section` | string | Road section (e.g., "S2D1") |
| `meter` | float | Meter position along road segment |
| `lane` | string | Lane code (1 or 2, indicating direction) |
| `heading` | float | Camera heading in degrees |
| `county_number` | int | Norwegian county number (50 = Trondheim region) |
| `image_type` | string | Camera type (Planar) |
| `detected_objects` | string | Auto-detected objects as JSON (e.g., `{"car": "1"}`) |
| `address_text` | string | Nearest address from Geonorge (e.g., "Innherredsveien 1, 7014 TRONDHEIM, TRONDHEIM") |
| `embedding` | list[float] | 3072-dim image embedding from `gemini-embedding-2-preview` |
### Road Category Distribution
| Category | Count | Description |
|---|---|---|
| F (County) | 31,412 | County roads |
| E (European) | 3,499 | European highways (e.g., E6, E39) |
| R (National) | 183 | National roads |
~82% of images have a resolved nearest address from [Geonorge](https://ws.geonorge.no/).
## 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. **Image metadata** was collected via the Vegbilder WFS endpoint, tiling the bounding box into 0.01-degree chunks
2. **Address enrichment** was performed using the [Geonorge punktsok API](https://ws.geonorge.no/adresser/v1/punktsok), with coordinate-grid caching at ~100m resolution
3. **Image thinning** was applied at 100m minimum spacing along each road segment to reduce redundancy (original dataset: 243,418 images)
4. **Embeddings** were generated using [Google Gemini Batch API](https://ai.google.dev/gemini-api/docs/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



