Note: This document is for an older version of GRASS GIS that has been discontinued. You should upgrade, and read the current manual page.

GRASS logo

NAME

i.sam2 - Integrates SAMGeo model with text prompt for segmentation in GRASS GIS.

KEYWORDS

imagery, segmentation, object recognition, deep learning

SYNOPSIS

i.sam2
i.sam2 --help
i.sam2 group=name output=name [checkpoint_dir=name] [text_prompt=string] [text_threshold=float] [box_threshold=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

group=name [required]
Name of input imagery group
output=name [required]
Name of output segmented raster map
checkpoint_dir=name
Path to the SAMGeo model checkpoint directory (optional if using default model)
text_prompt=string
Text prompt to guide segmentation
text_threshold=float
Text threshold for text segmentation
Default: 0.24
box_threshold=float
Box threshold for text segmentation
Default: 0.24

Table of contents

DESCRIPTION

i.sam2 allows users to segment orthoimagery based on text prompts using SamGeo.

REQUIREMENTS

        pip install pillow numpy torch segment-geospatial
    

EXAMPLES

Segment orthoimagery using SamGeo2:
    i.sam2 group=rgb_255 output=tree_mask text_prompt="trees"
    
i.sam2 example

NOTES

The first time use will be longer as the model needs to be downloaded. Subsequent runs will be faster. Additionally, CUDA is required for GPU acceleration. If you do not have a GPU, you can use the CPU by setting the environment variable `CUDA_VISIBLE_DEVICES` to `-1`.

REFERENCES

SEE ALSO

i.segment.gsoc for region growing and merging segmentation, i.segment.hierarchical performs a hierarchical segmentation, i.superpixels.slic for superpixel segmentation.

AUTHOR

Corey T. White (NCSU GeoForAll Lab & OpenPlains Inc.)

SOURCE CODE

Available at: i.sam2 source code (history)

Latest change: Friday Feb 21 16:56:09 2025 in commit: e9df778894099cc01bf63c325fa7b86db4e6c128


Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.3.3dev Reference Manual