Implementation:Open compass VLMEvalKit MEGABench Geo Proximity
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Geolocation, Proximity Scoring |
Overview
Implements geographic proximity scoring for location-based tasks in the MEGA-Bench evaluation framework using geopy distance calculation.
Description
This module provides `calculate_proximity_score` which computes an exponentially decaying score based on the geodesic distance between predicted and actual coordinates, with a configurable threshold `k` (default 100 km) at which the score reaches 0.5. It includes `try_geolocate` for cached geocoding lookups via Nominatim and `location_to_coords` for converting country/state/city strings to latitude/longitude coordinates. Rate limiting is applied to geocoding requests.
Usage
Called internally by the corresponding dataset class during evaluation.
Code Reference
- Source:
vlmeval/dataset/utils/megabench/scoring/geo_proximity.py, Lines: L1-100 - Import:
from vlmeval.dataset.utils.megabench.scoring.geo_proximity import calculate_proximity_score
Key Functions:
def calculate_proximity_score(guess_coords, actual_coords, k=100): ...
def try_geolocate(query): ...
def location_to_coords(country, province_or_state, municipality): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Predicted and actual coordinate tuples (latitude, longitude); or location strings (country, state, city) |
| Outputs | Float proximity score between 0 and 1, exponentially decaying with distance |
Usage Examples
from vlmeval.dataset.utils.megabench.scoring.geo_proximity import calculate_proximity_score
score = calculate_proximity_score((40.7128, -74.0060), (40.7580, -73.9855))