-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i.sam2: SamGeo2 model #1244
base: grass8
Are you sure you want to change the base?
i.sam2: SamGeo2 model #1244
Conversation
Cool, need to try this out. |
Co-authored-by: Markus Neteler <[email protected]>
Co-authored-by: Markus Neteler <[email protected]>
I've submitted PR: opengeos/segment-geospatial#370 to fix an upstream issue in the segment-geospatial library. |
Would you mind to add "trees.png" in a higher resolution (perhaps as JPG), at time it is only 640 x 480. The code for a clickable image figure is found at Please also change the name to |
So cool, @cwhite911! Would you mind adding the requirements and how to install it within the manual page as in here, for example. It would be more visible for users and clear, too. |
# %option | ||
# % key: text_prompt | ||
# % type: string | ||
# % description: Optional text prompt to guide segmentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text prompt is not optional (required is set to 'yes')
I tried to run this on Windows 10, GRAS GIS 8.4, installed via OSGeo4W. I am getting the following errors:
|
temp_output_path = tmp_dir | ||
guide_input_path = None | ||
|
||
rasters = gs.read_command("i.group", group=group, flags="lg").strip().split("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In windows at least, the elements in the resulting list 'rasters' have a trailing '\r', for example: ['lsat5_1987_10@landsat\r', 'lsat5_1987_20@landsat\r', 'lsat5_1987_30@landsat']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwhite911 The issue mentioned above can be resolved, I think, by replacing line 105 by:
rasters = gs.read_command("i.group", group=group, flags="lg")
rasters = [raster.strip() for raster in rasters.splitlines()]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwhite911 Please see feedback in code
A new module
i.sam2
for segmenting orthoimagery using text prompts with the SAMGeo model (Segment Anything Model Geospatial).i.sam2 group=rgb_255 output=tree_mask text_prompt="trees"