Skip to content

Utilities for modeling and visualizing SpaceNet data (Earth satellite imagery).

Notifications You must be signed in to change notification settings

andraugust/spacenet-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spacenet-utils

Utilities for modeling and visualizing SpaceNet data.

SpaceNet data is available on aws.

spacenet-utils dependencies: numpy, pandas, osgeo, matplotlib, geomet, scikit-learn.

Example usage

Display geotiff image with building-polygon overlay.

# python3
import spacenet_utils as snu
import matplotlib.pyplot as plt

# path to csv of ground-truth polygon vertices
csv_path = 'AOI_5_Khartoum_Train/summaryData/AOI_5_Khartoum_Train_Building_Solutions.csv'
# path to geotiff image
im_path = 'AOI_5_Khartoum_Train/MUL-PanSharpen/MUL-PanSharpen_AOI_5_Khartoum_img5.tif'

fig, ax = plt.subplots()
snu.plot_image(ax,im_path,band=7)
snu.plot_gt(ax,im_path,csv_path)
plt.show()

Example usage

Label buildings using kNN on the pixel spectra.

$ python example_knn.py

alt text

performance = 0.799041
confusion matrix = 
array([[288411,  13766],
       [ 71139,  49184]])
fscore = 0.536729360026

Note

example_knn.py has only been tested on MUL-PanSharpened images from the Khartoum region.

To use on a different region or image type, be sure to set the following kwargs in spacenet_utils.py: poly_verts2mask.w, postprocess.w, get_poly_arr.im_id_prefix, plot_gt.im_id_prefix.

See these functions' docstrings for further documentation.

About

Utilities for modeling and visualizing SpaceNet data (Earth satellite imagery).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages