Skip to main content

Meta AI' Segment Anything Model (SAM) for Geospatial Data

Project description

segment-geospatial

image image image image image Docker Pulls PyPI Downloads Conda Downloads

A Python package for segmenting geospatial data with the Segment Anything Model (SAM)

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.

Features

  • Download map tiles from Tile Map Service (TMS) servers and create GeoTIFF files
  • Segment GeoTIFF files using the Segment Anything Model (SAM)
  • Create foreground and background markers interactively
  • Load existing markers from vector datasets
  • Save segmentation results as common vector formats (GeoPackage, Shapefile, GeoJSON, etc.)
  • Save input prompts as GeoJSON files
  • Visualize segmentation results on interactive maps

Examples

Demos

  • Automatic mask generator

  • Interactive segmentation with input prompts

  • Input prompts from existing files

Tutorials

Video tutorials are available on my YouTube Channel.

Alt text

Using SAM with Desktop GIS

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

segment-geospatial-0.6.2.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

segment_geospatial-0.6.2-py2.py3-none-any.whl (26.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file segment-geospatial-0.6.2.tar.gz.

File metadata

  • Download URL: segment-geospatial-0.6.2.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for segment-geospatial-0.6.2.tar.gz
Algorithm Hash digest
SHA256 91ff1c265936bd85ac2b6489db5b97299238269e70bc3d53314bf6f725631e0c
MD5 e3d7e2b7a1b1e872bf20079071260236
BLAKE2b-256 25605cd7e912c9561574ced634e8df85153195b4967208df442f8837d7fa6d69

See more details on using hashes here.

File details

Details for the file segment_geospatial-0.6.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for segment_geospatial-0.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e29267df03f26cad4d7a6ac6c17a89a65b438f54a94a396efd77de992a5f0c13
MD5 bd324d150d67f2df86b5ffedb444c348
BLAKE2b-256 9b27dc091924a40aa185fb14d69415ae60c5cee2e587c7bc22f7437009856601

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page