Skip to main content
Glama
DeepPVMapper

DeepPVMapper

DeepPVMapper

License: MIT HF Models HF Dataset DOI DeepPVMapper MCP connector – tool definition quality and endpoint health on Glama

Large-scale rooftop PV detection pipeline for France. Classifies IGN aerial tiles with InceptionV3, segments positive patches with FCN/DeepLab, and extracts panel characteristics (surface, tilt, azimuth, installed capacity) via pypvroof.

🗺️ Official project page
Work carried out by Gabriel Kasmi as part of his PhD at Mines Paris-PSL (2020–2024).


MCP Server

DeepPVMapper MCP server

DeepPVMapper's detection registry is also exposed as a public MCP (Model Context Protocol) server over Streamable HTTP, so any MCP-compatible client (Claude, etc.) can query the 1.14M+ rooftop-solar detections directly via natural language: search detections, aggregate installed capacity by department, explore an area, track yearly deployment, and check data-quality signals.

No install required — add the endpoint as a custom connector in any MCP client.


Related MCP server: MeteoControl MCP Server

Mapping data

Pre-computed detection results for French departments are available on Zenodo:

DOI


Installation

GDAL must be installed system-wide first, then via pip to match the running Python version:

# Ubuntu/Debian
apt-get install -y gdal-bin libgdal-dev libopenjp2-7

pip install "GDAL==$(gdal-config --version)"
pip install -r requirements.txt

GPU required. CUDA 11.8+, 8 GB VRAM minimum.


Data and model weights

Download model weights and runtime data from Zenodo:

DOI

Model weights are also available on Hugging Face:

HF Models

The training dataset (BDAPPV):

HF Dataset

Fill in the source paths in config.yml before running:

config key

what goes there

source_images_dir

IGN JP2 tiles + dalles.shp index shapefile

source_topo_dir

BDTOPO folder (BATIMENT.shp, ZONE_D_ACTIVITE_OU_D_INTERET.shp)

source_commune_dir

folder containing communes-20210101.shp

model_dir

folder containing model_bdappv_cls.pth and model_bdappv_seg.pth


Usage

python main.py --dpt 06

--count sets tiles per classification batch (default 16 — reduce if OOM):

python main.py --dpt 06 --count 8

--config points to an alternative config file (useful for RunPod deployments):

python main.py --dpt 06 --config /workspace/config_runpod.yml

To process a subset of tiles (local testing), set tiles_list in config.yml:

tiles_list:
  - 01-2024-0850-6565-LA93-0M20-E080
  - 01-2024-0850-6570-LA93-0M20-E080

Force a full rerun (wipe prior progress):

python main.py --dpt 06 --clean

Pipeline

Four steps run sequentially inside main.py:

step

what happens

Init

Builds per-department auxiliary files (buildings, plants, communes) into temp/. Skipped if already present — safe to rerun after a crash.

Classification

Tiles loaded fully in memory. InceptionV3 classifies 299×299 patches; positives saved as GeoTIFFs to temp/segmentation/.

Segmentation

FCN/DeepLab segments each positive patch. LAMB93 polygons extracted, sorted by tile, merged into pseudo-arrays.

Aggregation

pypvroof extracts tilt/azimuth/kWp per polygon. Building filter applied. Results written to outputs_dir.

On success: temp/ is deleted automatically.
On crash: temp/ is kept. Rerun the same command to resume from where it stopped.


Outputs

Written to outputs_dir (default: data/):

file

description

arrays_{dpt}.geojson

Detected PV polygons in WGS84

characteristics_{dpt}.csv

Per-installation registry: surface (m²), tilt (°), azimuth (°), kWp, city code, lat, lon

aggregated_characteristics_{dpt}.csv

City-level aggregation: count, total kWp, avg surface, avg kWp

arrays_characteristics_{dpt}.geojson

Polygons enriched with all characteristics

Only residential-scale installations (1.7–36.1 kWp) located on buildings are retained.


Configuration reference

parameter

default

description

temp_dir

temp

Working directory. Deleted on success, kept on crash.

outputs_dir

data

Final outputs directory.

cls_threshold

0.4

Classification confidence threshold

cls_batch_size

512

Patches per GPU batch (classification)

decode_workers

3

Concurrent JP2 decode processes feeding the GPU — tune to your real CPU quota, not host core count

decode_stagger_s

35

Gap between initial decode submissions, to avoid lockstep bursty waits — rule of thumb: decode_time / decode_workers

seg_threshold

0.46

Segmentation binarization threshold

seg_batch_size

64

Images per GPU batch (segmentation)

filter_building

True

Discard detections not on a building

tilt_method

lut

pypvroof tilt method (lut or constant)

azimuth_method

bounding-box

pypvroof azimuth method

ic_method

clustered

pypvroof installed-capacity regression type

tiles_list

(empty)

Optional tile subset for partial runs


Contributing

Contributions are welcome — both code (performance, new imagery sources, models, building filters) and registry corrections via the interactive map, no coding required.

See CONTRIBUTING.md for the contribution areas, setup instructions and workflow. Issues labelled good first issue are the best entry points.


Known issues

GDAL is fragile to install, for two distinct reasons — and the fix below handles both.

  1. The pip GDAL binding must match the system libgdal version exactly. pip install GDAL fails to build, or segfaults at import, if its version differs from the system library.

  2. On images that ship a pre-installed python3-gdal apt package (common on RunPod/cloud GPU images), that package bundles its own osgeo/, which takes priority over the pip-installed one in sys.path — and its .so is often broken, regardless of what pip installs.

Run this in place of a plain pip install, e.g. right when deploying the pipeline, around the pip install -r requirements.txt step:

#!/usr/bin/env bash
set -e

# --- native GDAL lib (gdal-config must exist before pip can build the python binding) ---
apt-get update
apt-get install -y --no-install-recommends gdal-bin libgdal-dev

# --- purge python3-gdal if present: this apt package ships its own osgeo/,
#     which takes priority over the pip-installed one in sys.path, and its
#     .so is often broken ---
dpkg -l | grep -q python3-gdal && apt-get remove --purge -y python3-gdal || true
rm -rf /usr/lib/python3/dist-packages/osgeo

# --- python deps ---
pip install -r requirements.txt

# --- repin the pip GDAL binding to exactly match the native lib version
#     (requirements.txt only pins GDAL>=3.0, so pip can grab a newer
#     version than the one apt just installed -> ABI mismatch at import) ---
GDAL_VERSION=$(gdal-config --version)
pip install --no-cache-dir --force-reinstall "GDAL==${GDAL_VERSION}"

# --- check ---
python -c "
import torch
from osgeo import gdal
print('torch', torch.__version__, '| cuda', torch.cuda.is_available())
print('gdal', gdal.__version__, '| GTiff driver:', gdal.GetDriverByName('GTiff') is not None)
"

Citation

@phdthesis{kasmi2024enhancing,
  title={Enhancing the Reliability of Deep Learning Models to Improve the Observability of French Rooftop Photovoltaic Installations},
  author={Kasmi, Gabriel},
  year={2024},
  school={Universit{\'e} Paris sciences et lettres}
}

License

MIT

Available Tools

17 tools
aggregate_detection_capacityAInspect

Compute the total estimated installed capacity (kWp) and count of detections matching a set of filters — département, commune, capacity range, and cross-validation across sources (cross_validated) or imagery vintages (min_vintages) — plus a quality_summary for the summed sample. Unlike get_department_capacity_stats, which is a fixed pre-computed département-wide aggregate with no other filters, this tool sums a live filtered subset, up to max_rows detections. Example: "installed capacity in Gironde confirmed by at least two sources" -> dpt="33", cross_validated=true. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: max_rows (required), quality_filter (required), dpt, insee, +20 more.

count_detectionsAInspect

Count detections matching a set of filters, exactly, without downloading rows (fast, no row cap). Use this for "how many ..." questions, e.g. "how many installations have an RNB id?" -> has_rnb_id=true; "how many are identified by 2+ sources?" -> quality_filter=true; "how many come from OpenStreetMap?" -> sources_include=[2]. Returns the matching count, the unfiltered registry total and the percentage. Counts are DETECTED systems, not an inventory. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: quality_filter (required), breakdown_rnb_id (required), dpt, insee, +20 more.

get_community_activityAInspect

Get a snapshot of ongoing community contribution activity on the map: how many corrections are currently pending moderation, their breakdown by action type (add / modify / delete), and the most recent submissions (timestamp, action, target). Submitted free-text comments are intentionally excluded from this tool. This reflects unmoderated, unverified user activity, not the registry itself — do not present it as confirmed detection data.

Inputs: recent_limit (required).

get_community_activity_in_areaAInspect

Find pending, unmoderated community contributions relevant to a specific area, to answer "has anyone flagged anything here that is not in the registry yet?" Two independent filters: dpt finds pending edits/deletions (action=modify/delete) targeting existing detections in that département; a full bounding box (min_lon/min_lat/max_lon/max_lat) finds pending new additions (action=add) whose proposed footprint centroid falls inside it. Combine with get_department_capacity_stats / search_detections / get_detections_in_bbox for the confirmed registry picture, and present this separately and clearly as unverified, pending community input — not confirmed detection data. Free-text comments are never included.

Inputs: scan_limit (required), recent_limit (required), dpt, max_lat, +3 more.

get_data_quality_referenceAInspect

Return the DeepPVMapper/OpenPVMapper registry's documented data-quality characteristics: estimated detection recall, which fields are model-derived estimates vs. structural/observed fields, the source-encoding table, the recommended confidence threshold, confidence signals, and licensing/liability terms. Call this before advising how much to trust a result for a specific use case (e.g. exploratory research vs. a commercial or regulatory decision) — pair it with the quality_summary attached to search_detections / aggregate_detection_capacity results, which reflects the specific query rather than the registry as a whole.

Inputs: no named parameters.

get_department_capacity_statsAInspect

Get installed rooftop-PV capacity (total kWp) and system counts for one or all French départements, from the DeepPVMapper/OpenPVMapper registry. This is a fixed, pre-computed department-wide aggregate with no other filters — use aggregate_detection_capacity instead if you need a filtered subset (e.g. only cross-validated detections). Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: dpt, top_n.

get_department_profileAInspect

One-call profile of a département: installed capacity and national rank, yearly trend (by first-seen imagery year), source mix, share identified by 2+ sources, and share matched to an RNB building id. Cross-references the pre-computed department statistics with live counts. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: dpt (required).

get_department_yearly_statsAInspect

Get yearly system counts and capacity by département, based on first-seen imagery year. Useful for tracking apparent PV deployment growth over time. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: dpt.

get_detection_detailsAInspect

Get the full record of one detection by id: technical characteristics (surface, kwp, tilt, azimuth — model estimates), imagery years, sources decoded into plain labels, frpv_proba, false-positive flag, rnb_id and location codes, plus simple confidence signals. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: id (required).

get_detections_in_bboxAInspect

Get rooftop-PV detections within a geographic bounding box (WGS84 lon/lat), including footprint geometry. Intended for map-style spatial queries over a small area. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: max_lat (required), max_lon (required), min_lat (required), min_lon (required), +1 more.

get_field_coverageAInspect

Completeness report: for each optional field of the registry (rnb_id, frpv_proba, false_positive, false_positive_source), how many detections have it filled in and what percentage. Answers "how many installations have an RNB id / an FRPV comparison / a false-positive flag?" in one call, for France or one département. For a single filtered count use count_detections instead. Null means "not available/recorded", never "0" or "confirmed ok". Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: dpt.

get_field_distributionAInspect

Histogram of a numeric field (kwp, surface, tilt, azimuth, n_vintages, first_seen, last_seen) with exact counts per bin, for France or one département. Answers "how are installations distributed by size / tilt / orientation / year?". kwp, surface, tilt and azimuth are model estimates. first_seen/last_seen are imagery years, not installation dates. Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: field (required), quality_filter (required), dpt, max_year, +2 more.

get_field_referenceAInspect

Field-by-field documentation of a detection record: type, unit, nullability, whether it is observed or a model estimate, how to read it, and which tool filters or reports it. Call this when the user asks what a field means or how reliable it is.

Inputs: no named parameters.

get_source_breakdownAInspect

Break down detections by source code (0=DPVM pipeline, 1=FRPV reference, 2=OSM, 3=manual correction, 4=recall sample), for one département or all of France, with human-readable labels. A detection can carry several sources, so per-source counts overlap and do not add up to the total. Also returns how many detections are identified by 2+ sources (the meaning of quality_filter). Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: dpt.

get_source_referenceAInspect

Explain the data sources behind the registry's sources field: for each source, its code, short key, name, accepted aliases, and where the data comes from (with references: code, thesis, papers). Use it for questions like "what is FRPV?", "where does the OSM data come from?", "what is a manual correction?". The sources field answers "where do we have this installation?": each listed code is a dataset or process that contains it. Example: "0,1" = present in both DeepPVMapper (DPVM) and FRPV; "0,2" = present in DeepPVMapper and OpenStreetMap.

Inputs: source.

get_startedAInspect

START HERE. Call this first when the user is new, asks what this server can do, or asks a vague question about DeepPVMapper. Returns a plain-language introduction, example questions, which tool answers which kind of question, a glossary and the main caveats. Reply to the user in their own language.

Inputs: no named parameters.

search_detectionsAInspect

Search individual rooftop-PV detections by département, commune (INSEE code), estimated capacity range, and/or cross-validation confidence (min_vintages, cross_validated). Returns a bounded list of detection records plus a quality_summary for the returned sample (use get_detections_in_bbox instead for map/spatial queries with geometry). Data quality note: this is a detection dataset, not an exhaustive inventory (estimated recall ~0.6). A missing detection does not mean no PV installation exists there. kwp, surface, tilt and azimuth are model estimates, not surveyed values. In this server, quality_filter=true keeps only detections identified by 2 or more sources (see source_encoding in get_data_quality_reference). Call get_data_quality_reference for the full picture before assessing fitness for a specific use case.

Inputs: limit (required), quality_filter (required), dpt, insee, +20 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have clearly distinct query targets, and descriptions explicitly cross-reference alternatives ('use aggregate_detection_capacity instead if...', 'use get_detections_in_bbox for spatial queries'). The main risk is the cluster of reference tools (get_data_quality_reference, get_field_reference, get_source_reference) and the department-level tools (get_department_capacity_stats, get_department_yearly_stats, get_department_profile), which overlap somewhat but are adequately differentiated in text.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern (get_*, search_*, aggregate_*, count_*), with the domain noun consistently indicating the resource or scope (detection, department, field, source, community). No mixed conventions or casing inconsistencies.

    Tool Count4/5

    17 tools is on the heavier end but each earns its place across distinct axes: entry/help, references, single-record lookup, filtered search, spatial search, counting, aggregation, distributions, coverage, and community activity. A couple of tools (e.g. get_department_profile) could arguably be folded into others, keeping it just short of ideal.

    Completeness4/5

    The read-only query surface is comprehensive: introduction/help, quality metadata, field and source references, single-record detail, filtered counts and searches, spatial bbox queries, department aggregations and trends, field distributions and coverage, plus unmoderated community activity. The only apparent gap is the absence of any write/contribution tool (e.g. submitting or moderating a correction), though this may be intentionally out of scope.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to look up solar permitting authorities, estimate solar production via PVWatts, and retrieve irradiance data. It streamlines the creation of solar-aware workflows by integrating industry-standard APIs like NREL.
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      An MCP server that enables natural language interaction with the MeteoControl VCOM API v2 for monitoring solar array installations. It allows users to retrieve real-time and historical energy data, system alerts, and detailed asset configuration metrics.
      4
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      A lean Model Context Protocol (MCP) server that gives AI assistants like Claude structured access to a SolarEdge PV installation via the official SolarEdge Monitoring API.
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides free energy intelligence APIs for AI agents: solar production estimates, US clean-energy incentives by ZIP, home Energy Node Scores, contractor search, and consented installer routing.
      MIT