Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions docs/examples/extreme_weather/Austin_hail_damage_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -132,9 +130,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -715,9 +711,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "mesh_test3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "mesh_test3"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -729,7 +725,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
457 changes: 131 additions & 326 deletions docs/examples/panel_detection/Panel_Detection_example.ipynb

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions docs/examples/panel_detection/Sol-Searcher_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -201,9 +199,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -329,9 +325,7 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"solar_install_address_list = list()\n",
Expand Down Expand Up @@ -1200,9 +1194,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "panel_seg_extreme_weather",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "panel_seg_extreme_weather"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1214,7 +1208,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
527 changes: 0 additions & 527 deletions docs/examples/panel_detection/Train_Model_Example.ipynb

This file was deleted.

37 changes: 2 additions & 35 deletions docs/index_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,6 @@ Panel Detection
---------------
Generates satellite images and runs DL and CV routines on images to get array azimuth and mounting type/configuration.

.. autosummary::
:toctree: generated/
:caption: Panel Detection

panel_detection.PanelDetection
panel_detection.PanelDetection.generateSatelliteImage
panel_detection.PanelDetection.classifyMountingConfiguration
panel_detection.PanelDetection.diceCoeff
panel_detection.PanelDetection.diceCoeffLoss
panel_detection.PanelDetection.testBatch
panel_detection.PanelDetection.testSingle
panel_detection.PanelDetection.hasPanels
panel_detection.PanelDetection.detectAzimuth
panel_detection.PanelDetection.cropPanels
panel_detection.PanelDetection.plotEdgeAz
panel_detection.PanelDetection.clusterPanels
panel_detection.PanelDetection.runSiteAnalysisPipeline

Panel Training
---------------
Deep learning model training and development tools.

.. autosummary::
:toctree: generated/
:caption: Panel Training

panel_train.TrainPanelSegmentationModel
panel_train.TrainPanelSegmentationModel.loadImagesToNumpyArray
panel_train.TrainPanelSegmentationModel.diceCoeff
panel_train.TrainPanelSegmentationModel.diceCoeffLoss
panel_train.TrainPanelSegmentationModel.trainSegmentation
panel_train.TrainPanelSegmentationModel.trainPanelClassifier
panel_train.TrainPanelSegmentationModel.trainMountingConfigClassifier
panel_train.TrainPanelSegmentationModel.trainingStatistics


Utilities
---------
Expand All @@ -64,6 +29,8 @@ Helper functions and utilities.
utils.binaryMaskToPolygon
utils.convertMaskToLatLonPolygon
utils.convertPolygonToGeojson
utils.detectAzimuth
utils.plotEdgeAz

LiDAR
-----
Expand Down
51 changes: 51 additions & 0 deletions panel_segmentation.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Metadata-Version: 2.4
Name: panel_segmentation
Version: 0.0.0
Summary: A package to segment solar panels from a satellite image and perform automated metadata extraction.
Author-email: Kirsten Perry <kirsten.perry@nrel.gov>, Quyen Nguyen <nguyquye@oregonstate.edu>, Kevin Anderson <kevin.anderson@snl.gov>, Christopher Campos <chris.acampos@yahoo.com>, Ayobami Edun <aedun@ufl.edu>
License: MIT
Project-URL: Homepage, https://github.com/NREL/Panel-Segmentation
Keywords: photovoltaic,solar,analytics,analysis,performance,PV,satellite
Requires-Python: >=3.8
License-File: LICENSE
Requires-Dist: opencv-python-headless==4.6.0.66
Requires-Dist: numpy>=1.18.1
Requires-Dist: scikit_image>=0.16.2
Requires-Dist: matplotlib>=3.1.3
Requires-Dist: requests>=2.22.0
Requires-Dist: tensorflow>=2.2.0
Requires-Dist: pandas>=1.1.4
Requires-Dist: Pillow>=8.0.1
Requires-Dist: scikit_learn>=0.23.2
Requires-Dist: h5py>=2.10.0
Requires-Dist: detecto>=1.2.1
Requires-Dist: torch>=1.9.0
Requires-Dist: torchvision>=0.10.0
Requires-Dist: mmdet==3.3.0
Requires-Dist: mmengine==0.10.7
Requires-Dist: kornia
Requires-Dist: scipy
Requires-Dist: rasterio
Requires-Dist: geopandas
Requires-Dist: beautifulsoup4==4.12
Requires-Dist: dash==2.6.0
Requires-Dist: laspy[laszip]==2.5.4
Requires-Dist: open3d==0.18.0
Requires-Dist: pyarrow==17.0.0
Requires-Dist: pyproj==3.5.0
Requires-Dist: boto3>=1.37.38
Requires-Dist: cfgrib>=0.9.15.0
Requires-Dist: folium>=0.18.0
Requires-Dist: simplekml>=1.3.6
Requires-Dist: xarray>=2023.1.0
Provides-Extra: doc
Requires-Dist: sphinx==5.0; extra == "doc"
Requires-Dist: jinja2<3.1; extra == "doc"
Requires-Dist: pydata-sphinx-theme==0.14.0; extra == "doc"
Requires-Dist: ipython; extra == "doc"
Requires-Dist: nbsphinx; extra == "doc"
Requires-Dist: sphinx_copybutton; extra == "doc"
Provides-Extra: test
Requires-Dist: pytest>=5.3.5; extra == "test"
Provides-Extra: optional
Dynamic: license-file
30 changes: 30 additions & 0 deletions panel_segmentation.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
LICENSE
MANIFEST.in
README.md
pyproject.toml
versioneer.py
panel_segmentation/__init__.py
panel_segmentation/_version.py
panel_segmentation/utils.py
panel_segmentation.egg-info/PKG-INFO
panel_segmentation.egg-info/SOURCES.txt
panel_segmentation.egg-info/dependency_links.txt
panel_segmentation.egg-info/not-zip-safe
panel_segmentation.egg-info/requires.txt
panel_segmentation.egg-info/top_level.txt
panel_segmentation/lidar/__init__.py
panel_segmentation/lidar/pcd_data.py
panel_segmentation/lidar/plane_segmentation.py
panel_segmentation/lidar/usgs_lidar_api.py
panel_segmentation/models/hail_config.py
panel_segmentation/models/hail_model.pth
panel_segmentation/models/post_hurricane_config.py
panel_segmentation/models/post_hurricane_model.pth
panel_segmentation/models/pre_hurricane_config.py
panel_segmentation/models/pre_hurricane_model.pth
panel_segmentation/models/sol_searcher_config.py
panel_segmentation/models/sol_searcher_model.pth
panel_segmentation/tests/README.md
panel_segmentation/tests/__init__.py
panel_segmentation/tests/test_panel_detection.py
panel_segmentation/tests/test_utils.py
1 change: 1 addition & 0 deletions panel_segmentation.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions panel_segmentation.egg-info/not-zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

43 changes: 43 additions & 0 deletions panel_segmentation.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
opencv-python-headless==4.6.0.66
numpy>=1.18.1
scikit_image>=0.16.2
matplotlib>=3.1.3
requests>=2.22.0
tensorflow>=2.2.0
pandas>=1.1.4
Pillow>=8.0.1
scikit_learn>=0.23.2
h5py>=2.10.0
detecto>=1.2.1
torch>=1.9.0
torchvision>=0.10.0
mmdet==3.3.0
mmengine==0.10.7
kornia
scipy
rasterio
geopandas
beautifulsoup4==4.12
dash==2.6.0
laspy[laszip]==2.5.4
open3d==0.18.0
pyarrow==17.0.0
pyproj==3.5.0
boto3>=1.37.38
cfgrib>=0.9.15.0
folium>=0.18.0
simplekml>=1.3.6
xarray>=2023.1.0

[doc]
sphinx==5.0
jinja2<3.1
pydata-sphinx-theme==0.14.0
ipython
nbsphinx
sphinx_copybutton

[optional]

[test]
pytest>=5.3.5
1 change: 1 addition & 0 deletions panel_segmentation.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
panel_segmentation
2 changes: 0 additions & 2 deletions panel_segmentation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from panel_segmentation.panel_detection import PanelDetection
from panel_segmentation.panel_train import TrainPanelSegmentationModel
from panel_segmentation import lidar

from ._version import get_versions
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 14 additions & 28 deletions panel_segmentation/lidar/pcd_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,24 @@ def readLaz(self, chunk_size=1000000):
# Ensure that the inputs are of the correct type
if not isinstance(chunk_size, int):
raise TypeError("chunk_size variable must be of type int.")
# Process LiDAR data in chunks since .laz files are large
with laspy.open(self.laz_file_path) as f:
final_point_record = laspy.PackedPointRecord.empty(
f.header.point_format)
# Get crs of LiDAR data
with laspy.open(self.laz_file_path) as f:
self.source_crs = f.header.parse_crs()
# Check if crs has multiple components
if self.source_crs.is_compound:
# Get horizontal crs
# Only need horizontal projection since Shapely polygon is 2D
horizontal_crs = self.source_crs.sub_crs_list[0]
dst_crs = f"EPSG:{horizontal_crs.to_epsg()}"
if self.source_crs is None:
# Some USGS LAZ tiles have no embedded CRS — assume UTM NAD83 as a
# fallback.
print("No CRS found in %s -- falling back to EPSG:4269 (NAD83).",
self.laz_file_path)
dst_crs = "EPSG:4269"
elif self.source_crs.is_compound:
# Compound CRS (e.g. horizontal + vertical) -- take the horizontal component
dst_crs = f"EPSG:{self.source_crs.sub_crs_list[0].to_epsg()}"
else:
dst_crs = f"EPSG:{self.source_crs.to_epsg()}"
# Make coordinate transformer from EPSG:4326 to LiDAR crs
self.transformer = Transformer.from_crs(
"EPSG:4326", dst_crs, always_xy=True)
# Get [x, y] scale factors to match transformed lat long
# to array values
self.scales = f.header.scales

self.transformer = Transformer.from_crs("EPSG:4326", dst_crs, always_xy=True)
self.scales = f.header.scales
self.offsets = f.header.offsets
# Get the points in chunks
points_list = []
for points in f.chunk_iterator(chunk_size):
points_list.append(points.array)
# Combine all chunks
concatenated_points = np.concatenate(points_list)
# Combine the points together and create a new LasData object
final_point_record.array = concatenated_points
laz_data = laspy.LasData(header=f.header)
laz_data.points = final_point_record
return laz_data
return laspy.read(self.laz_file_path)

def filterLaz(self, laz_data, classification_list=[1, 6],
lat_lon_bbox_size=20):
Expand Down
Loading
Loading