coolzhao / Geo-SAM

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After adding a custom image and extracting its features, clicking on the image resulted in the following error message

BigBigOranges opened this issue · comments

2024-03-12T17:29:22 WARNING Traceback (most recent call last):
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\geo_sam_tool.py", line 387, in execute_segmentation
self.ensure_polygon_sam_exist()
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\geo_sam_tool.py", line 369, in ensure_polygon_sam_exist
self.load_shp_file()
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\geo_sam_tool.py", line 458, in load_shp_file
self.polygon = SAM_PolygonFeature(
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\canvasTool.py", line 398, in init
self.init_layer()
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\canvasTool.py", line 402, in init_layer
self._load_shapefile(self.shapefile)
File "C:\Users/njchy1303/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\canvasTool.py", line 430, in _load_shapefile
fields.extend(
TypeError: QgsFields.extend(): argument 1 has unexpected type 'list'

Hi @BigBigOranges,

Please first ensure that the output shapefile of Geo-SAM is correct. It is recommended to directly click on ... after Output Layer or File option to select a path and create a new one. If the issue persists, please download the main library code and replace the original code to test it.

Replacing the main program code has solved the problem. Thank you for your answer.