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 was trying to use the everything_prompt and return the masks. Running the fast_show_mask function gave me an error message "AttributeError: 'SamGeo' object has no attribute 'image'."
The same code and image works as expected and does not throw an error if I use sam.show_anns("mask.png") instead of fast_show_mask.
What I Did
My Code:
from samgeo.fast_sam import SamGeo
image = 'local_image.tif'
sam = SamGeo(model="FastSam-x.pt")
sam.set_image(image)
segments = "segment.tif"
sam.everything_prompt(segments)
mask_result = sam.fast_show_mask()
Stack Trace:
Traceback (most recent call last):
File "<local_file_path>\src\segment_geospatial\fast_sam.py", line 17, in <module>
mask_result = sam.fast_show_mask()
^^^^^^^^^^^^^^^^^^^^
File "<local_file_path>\env\Lib\site-packages\samgeo\fast_sam.py", line 231, in fast_show_mask
target_height = self.image.shape[0]
^^^^^^^^^^
File "<local_file_path>\env\Lib\site-packages\fastsam\model.py", line 106, in __getattr__
raise AttributeError(f"'{name}' object has no attribute '{attr}'. See valid attributes below.\n{self.__doc__}")
AttributeError: 'SamGeo' object has no attribute 'image'. See valid attributes below.
Segmenting remote sensing images with the Fast Segment Anything Model (FastSAM).
The text was updated successfully, but these errors were encountered:
Environment Information
Description
I was trying to use the
everything_prompt
and return the masks. Running the fast_show_mask function gave me an error message "AttributeError: 'SamGeo' object has no attribute 'image'."The same code and image works as expected and does not throw an error if I use
sam.show_anns("mask.png")
instead of fast_show_mask.What I Did
My Code:
Stack Trace:
The text was updated successfully, but these errors were encountered: