You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am using Samgeo and Samgeo2 for segment, how can i get the segment result by types. such as trees, buildings. from the API reference, Samgeo2 generate has return result which is "A list of dictionaries containing the generated masks". I tested it and only get None result. Did I get something wrong? here is the code:
`
from samgeo import SamGeo2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
i am using Samgeo and Samgeo2 for segment, how can i get the segment result by types. such as trees, buildings. from the API reference, Samgeo2 generate has return result which is "A list of dictionaries containing the generated masks". I tested it and only get None result. Did I get something wrong? here is the code:
`
from samgeo import SamGeo2
sam2 = SamGeo2(model_id="sam2-hiera-large", automatic=True)
image = '/mnt/data/qiaozh/samgeo/test/68.tif'
mask = "segment.tif"
result = sam2.generate(
image, mask, batch=True, foreground=True, erosion_kernel=(3, 3), mask_multiplier=255
)
print(result) // print None
shapefile = "segment.shp"
sam2.raster_to_vector(mask, shapefile)
`
Beta Was this translation helpful? Give feedback.
All reactions