coolzhao / Geo-SAM

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.
MIT License
241 stars 37 forks source link

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

Open BigBigOranges opened 8 months ago

BigBigOranges commented 8 months ago

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'

Fanchengyan commented 8 months ago

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.

BigBigOranges commented 8 months ago

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

vincentdulout commented 2 weeks ago

I have a similar message

2024-11-07T17:26:58 WARNING Traceback (most recent call last): File "C:\Users/vince/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/vince/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\canvasTool.py", line 398, in init self.init_layer() File "C:\Users/vince/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/vince/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'

I created a new output shapefile.

Note I just installed the plugin this week. How can I correct the situation?

Thanks in advance

Fanchengyan commented 2 weeks ago

Hi @vincentdulout

Which version of Geo-SAM are you using? The latest version v1.3-rc should not have this issue.

vincentdulout commented 2 weeks ago

Thanks, that's works, not completly but it's the segmantation