Meta AI' Segment Anything Model (SAM) for Geospatial Data
Project description
segment-geospatial
A Python package for segmenting geospatial data with the Segment Anything Model (SAM)
Introduction
The segment-geospatial package draws its inspiration from segment-anything-eo repository authored by Aliaksandr Hancharenka. To facilitate the use of the Segment Anything Model (SAM) for geospatial data, I have developed the segment-anything-py and segment-geospatial Python packages, which are now available on PyPI and conda-forge. My primary objective is to simplify the process of leveraging SAM for geospatial data analysis by enabling users to achieve this with minimal coding effort. I have adapted the source code of segment-geospatial from the segment-anything-eo repository, and credit for its original version goes to Aliaksandr Hancharenka.
- Free software: MIT license
- Documentation: https://samgeo.gishub.org
Citations
- Qiusheng Wu, & Lucas Osco. (2023). samgeo: A Python package for segmenting geospatial data with the Segment Anything Model (SAM). Zenodo. https://doi.org/10.5281/zenodo.7966658
Features
- Download map tiles from Tile Map Service (TMS) servers and create GeoTIFF files
- Segment GeoTIFF files using the Segment Anything Model (SAM)
- Segment remote sensing imagery with text prompts
- Create foreground and background markers interactively
- Load existing markers from vector datasets
- Save segmentation results as common vector formats (GeoPackage, Shapefile, GeoJSON)
- Save input prompts as GeoJSON files
- Visualize segmentation results on interactive maps
Examples
- Segmenting satellite imagery
- Automatically generating object masks
- Segmenting satellite imagery with input prompts
- Segmenting imagery with text prompts
- Using segment-geospatial with ArcGIS Pro
Demos
- Automatic mask generator
- Interactive segmentation with input prompts
- Input prompts from existing files
- Interactive segmentation with text prompts
Tutorials
Video tutorials are available on my YouTube Channel.
- Automatic mask generation
- Using SAM with ArcGIS Pro
- Interactive segmentation with text prompts
Using SAM with Desktop GIS
- QGIS: Check out the Geometric Attributes plugin for QGIS. Credit goes to Bjorn Nyberg.
- ArcGIS: Check out the Segment Anything Model (SAM) Toolbox for ArcGIS. Credit goes to Esri.
Computing Resources
The Segment Anything Model is computationally intensive, and a powerful GPU is recommended to process large datasets. It is recommended to have a GPU with at least 8 GB of GPU memory. You can utilize the free GPU resources provided by Google Colab. Alternatively, you can apply for AWS Cloud Credit for Research, which offers cloud credits to support academic research. If you are in the Greater China region, apply for the AWS Cloud Credit here.
Acknowledgements
This package was made possible by the following open source projects. Credit goes to the developers of these projects.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file segment-geospatial-0.8.1.tar.gz
.
File metadata
- Download URL: segment-geospatial-0.8.1.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98590c82660fc5ff5be3aa4f87ad9b663ce0b9507e321b16605caf08e5a75e1d |
|
MD5 | addcf839c3917ab156aba254159e1e09 |
|
BLAKE2b-256 | d11c7e2c35f91c6966e4956cea77f9d2a42b533d7804bb553c2215beb1236410 |
File details
Details for the file segment_geospatial-0.8.1-py2.py3-none-any.whl
.
File metadata
- Download URL: segment_geospatial-0.8.1-py2.py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d736e89afcc0ba3e10b3dad9f53f718265459ac872ca6d8c2d35134ff622483c |
|
MD5 | ae9ca85529fe718b8c133047cb91ce96 |
|
BLAKE2b-256 | 70fca19bf33c96d6c3cc898b81b677e4cbed450d223f95bafa5846fdcb0f4c98 |