Skip to content

Commit e0c2e72

Browse files
kperrynrelPerry
andauthored
Updates to the autogeotagging algo for cleaning + speedup (#59)
* added utils functions for autogeotagging + updated to vectorized lat-lon translation to save time * updated the tracker docs with the cleanup sequence--need to test * added rect standardization functions to utils * updated both geotagging examples with the new code * add egg info to gitignore * more fixing of broken unit tests * updated more unit tests * unit tests for the new functions * update * tons of docstring + pep8 adjustments * update the unit tests * check that all of the jupyter notebooks successfully run with updated functions + update all the documentation with new functions, etc * make the readme look less trash * update the readme again * update the license call --------- Co-authored-by: Perry <kperry@nrel.gov>
1 parent fbf1913 commit e0c2e72

10 files changed

Lines changed: 1147 additions & 448 deletions

File tree

README.md

Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,88 @@
11
![Panel Segmentation Icon](docs/_static/panel_segmentation_cropped_icon.png)
22

3-
This repo contains the scripts for automated metadata extraction of solar PV installations,
4-
using satellite imagery coupled with computer vision techniques. In this package, the user
5-
can perform the following actions:
6-
- Automatically generate a satellite image using a set of lat-long coordinates, and a Google
7-
Maps API key. To get a Google Maps API key, go to the following site and set up an account:
8-
https://developers.google.com/maps/documentation/maps-static/get-api-key
9-
- Determine the presence of a solar array in the satellite image (boolean True/False), using a
10-
classification model (VGG16_classification_model.h5).
11-
- Perform image segmentation on the satellite image, to locate the solar array(s) in the
12-
image on a pixel-by-pixel basis, using an image segmentation model (VGG16Net_ConvTranpose_complete.h5).
13-
- Using connected components clustering, isolate individual solar arrays in the masked image.
14-
- Perform azimuth estimation on each solar array cluster in the masked image.
15-
- Using an object detection model (Faster R-CNN Resnet 50 trained via transfer learning), detect
16-
and classify mounting type and configuration of solar installations in satellite imagery. This includes
17-
classification of fixed tilt and single-axis trackers, as well as the rooftop,
18-
ground, and carport mounting configurations.
19-
- Detect solar panels and get its latitude, longitude, and address within a geographic bounding box through the SOL-Searcher Pipeline.
20-
- Detect and calculate hurricane damage on solar installations given pre-hurricane and post-hurricane satellite imagery through the Hurricane Detection Pipeline.
21-
- Detect and calculate hail damage on solar installations given satellite imagery through the Hail Detection pipeline.
22-
- Convert NOAA MESH (Maximum Estimated Size of Hail) grib2 files into kml or geojson files.
23-
- Estimate tilt and azimuth of a solar array by processing USGS LiDAR data for the array's location.
24-
- Automatically estimate the solar array's tilt and azimuth by pulling and processing USGS LiDAR data
25-
within a shapely polygon outlining the solar array.
26-
27-
To install Panel-Segmentation, perform the following steps:
28-
29-
1. You must have Git large file storage (lfs) on your computer in order to download the deep learning models in this package. Go to the following site to download Git lfs:
30-
31-
https://git-lfs.github.com/
32-
33-
2. Once git lfs is installed, you can now install Panel-Segmentation on your computer. We are still working on making panel-segmentation available via PyPi, so entering the following in the command line will install the package locally on your computer:
34-
35-
git clone https://github.com/NatLabRockies/Panel-Segmentation.git
3+
# Panel-Segmentation
4+
5+
Automated metadata extraction for solar PV installations using satellite imagery and computer vision.
6+
7+
[![Build Status](https://github.com/NREL/Panel-Segmentation/actions/workflows/pytest.yaml/badge.svg)](https://github.com/NREL/Panel-Segmentation/actions)
8+
[![Documentation Status](https://readthedocs.org/projects/panel-segmentation/badge/?version=latest)](https://panel-segmentation.readthedocs.io/en/latest/)
9+
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10+
11+
---
12+
13+
## Overview
14+
15+
Panel-Segmentation provides tools to detect, locate, and characterize solar PV installations from satellite and aerial imagery. It is developed at the [National Renewable Energy Laboratory (NREL)](https://www.nrel.gov/).
16+
17+
**Capabilities include:**
18+
19+
- **Satellite image retrieval** — pull imagery for any lat/lon coordinate via the Google Maps Static API
20+
- **Solar panel detection** — locate panels and retrieve their latitude, longitude, and address within a geographic bounding box (SOL-Searcher Pipeline)
21+
- **Storm damage assessment** — detect and quantify hurricane or hail damage on solar installations from before/after satellite imagery
22+
- **NOAA MESH conversion** — convert NOAA Maximum Estimated Size of Hail (MESH) grib2 files to KML or GeoJSON
23+
- **Tilt and azimuth estimation** — estimate array tilt and azimuth from USGS LiDAR data
24+
- **Mounting configuration classification** — identify roof-mount, ground-mount, carport, and other configurations using an instance segmentation model
25+
- **Site autotagging** — geolocate tracker rows, fixed-tilt rows, and inverters at utility-scale ground-mount sites using a deep learning pipeline
26+
27+
---
28+
29+
## Installation
30+
31+
### Prerequisites
32+
33+
Panel-Segmentation stores deep learning model weights via [Git Large File Storage (LFS)](https://git-lfs.github.com/). Install Git LFS before cloning:
34+
35+
```bash
36+
# macOS
37+
brew install git-lfs
38+
39+
# Linux
40+
sudo apt install git-lfs
41+
42+
# Then initialize
43+
git lfs install
44+
```
45+
46+
### Install from source
47+
48+
```bash
49+
git clone https://github.com/NREL/Panel-Segmentation.git
3650
cd Panel-Segmentation
3751
pip install .
52+
```
3853

39-
3. Panel-Segmentation requires the MMCV package, which can be tricky to install for CPU-only, and needs to be installed from source. To install MMCV for source, run the following in the command line:
54+
### Install MMCV (required for storm damage models)
4055

56+
All CV models depend on MMCV, which must be built from source:
57+
58+
```bash
4159
pip install git+https://github.com/open-mmlab/mmcv.git@v2.1.0
60+
```
61+
62+
> **Note:** MMCV installation may take several minutes.
63+
64+
---
65+
66+
## Documentation
67+
68+
Full documentation — including installation guides, API reference, pipeline tutorials, and example notebooks — is available at **[panel-segmentation.readthedocs.io](https://panel-segmentation.readthedocs.io/en/latest/)**.
69+
70+
---
71+
72+
## Contributing
73+
74+
Contributions are welcome. Please open an issue or pull request on [GitHub](https://github.com/NREL/Panel-Segmentation).
75+
76+
---
4277

43-
Please note that installation will likely take several minutes, but is necessary for running any of the storm-related CV models.
78+
## Citation
4479

45-
3. When initiating the PanelDetection() class, be sure to point your file paths to the model paths in your local Panel-Segmentation folder!
80+
If you use Panel-Segmentation in your research, please cite it using the following citation:
4681

82+
K. Perry and C. Campos, "Panel Segmentation: A Python Package for Automated Solar Array Metadata Extraction Using Satellite Imagery," in IEEE Journal of Photovoltaics, vol. 13, no. 2, pp. 208-212, March 2023, doi: 10.1109/JPHOTOV.2022.3230565.
4783

84+
---
4885

86+
## License
4987

88+
Panel-Segmentation is released under the [BSD 3-Clause License](LICENSE).

docs/changelog/1.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Scripts
1616
- Added the scripts for LiDAR pipeline in the lidar folder :py:mod:`panel_segmentation.lidar`. (:pull:`45`)
1717
- Added unit testing for all functions in the lidar folder. (:pull:`45`)
1818
- Added new panel-detection instance segmentation model and deprecated old models. This standardized all model architecture to MMDetetection (remove detecto dependency). (:pull:`55`)
19+
- Added new utils functions for faster computation + post-processing of autogeotagging pipeline, including :py:func:`panel_segmentation.utils.getRectangleDimensions`
20+
and :py:func:`panel_segmentation.utils.standardizeRectangleWidth`. Updated existing functions for polygon generation from DL masks to be vectorized. (:pull:`59`)
1921

2022
Bug Fixes
2123
~~~~~~~~~

docs/examples/automated_geotagging/automated_geotagging_fixed_tilt_site.ipynb

Lines changed: 186 additions & 39 deletions
Large diffs are not rendered by default.

docs/examples/automated_geotagging/automated_geotagging_tracking_site.ipynb

Lines changed: 290 additions & 240 deletions
Large diffs are not rendered by default.

docs/examples/extreme_weather/Austin_hail_damage_example.ipynb

Lines changed: 38 additions & 20 deletions
Large diffs are not rendered by default.

docs/examples/extreme_weather/Hurricane_damage_example.ipynb

Lines changed: 49 additions & 21 deletions
Large diffs are not rendered by default.

docs/examples/panel_detection/Panel_Detection_example.ipynb

Lines changed: 11 additions & 27 deletions
Large diffs are not rendered by default.

docs/index_api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Helper functions and utilities.
2727
utils.convertPolygonToGeojson
2828
utils.detectAzimuth
2929
utils.plotEdgeAz
30+
utils.getRectangleDimensions
31+
utils.standardizeRectangleWidth
3032

3133
LiDAR
3234
-----

0 commit comments

Comments
 (0)