coolzhao / Geo-SAM

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

Some errors #10

Open wilson733 opened 11 months ago

wilson733 commented 11 months ago

I can't get either tool to work, the targeting tool gives the following error: Point/rectangle is located outside of the feature boundary, click OK to undo last prompt.

the encoder: Versión de QGIS: 3.32.1-Lima Revisión del código de QGIS: 4a078ecf63 Versión de Qt: 5.15.3 Python version: 3.9.5 Versión de GDAL: 3.7.1 Versión de GEOS: 3.12.0-CAPI-1.18.0 Versión de PROJ: Rel. 9.2.1, June 1st, 2023 PDAL version: 2.5.5 (git-version: a7569c) El algoritmo comenzó en: 2023-08-01T20:46:48 Algoritmo 'Geo-SAM Image Encoder' comenzando… Parámetros de entrada: { 'BANDS' : [1,2,3], 'BATCH_SIZE' : 1, 'CKPT' : 'C:\Users\win10\Downloads\sam_vit_b_01ec64.pth', 'CRS' : None, 'CUDA' : True, 'CUDA_ID' : 0, 'EXTENT' : None, 'INPUT' : 'C:/Users/win10/Downloads/S2B_tile_20230531_20HQK_0_B04,B03,B02M[-60.20466613769531,-32.18055246311917,-60.01376152038575,-32.07981104658545].tiff', 'LOAD' : True, 'MODEL_TYPE' : 2, 'OUTPUT' : 'TEMPORARY_OUTPUT', 'RANGE' : [nan,nan], 'RESOLUTION' : None, 'STRIDE' : 512 }

Input data value range to be rescaled: [0.0, 255.0] (automatically set based on min-max value of input image inside the processing extent.) Band statistics took time 0.018s Layer path: C:/Users/win10/Downloads/S2B_tile_20230531_20HQK_0_B04,B03,B02M[-60.20466613769531,-32.18055246311917,-60.01376152038575,-32.07981104658545].tiff Layer name: S2B_tile_20230531_20HQK_0_B04,B03,B02M[-60 Layer CRS: EPSG:3857 Layer pixel size: 23.6041364960745, 23.604136496075096 meters Bands selected: [1, 2, 3] Target CRS: EPSG:3857 Target resolution: 23.6041364960745 meters Processing extent: minx:-6701952.773631, maxx:-6680709.050785,miny:-3787033.547178, maxy:-3773791.626604 Processing image size: (width 900, height 561) Traceback (most recent call last): File "C:\Users/win10/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\sam_processing_algorithm.py", line 471, in processAlgorithm rlayer_ds = SamTestRasterDataset( File "C:\Users/win10/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\torchgeo_sam.py", line 417, in init super().init(root, crs, res, bands, transforms, cache) File "C:\Users\win10\AppData\Roaming\Python\Python39\site-packages\torchgeo\datasets\geo.py", line 370, in init raise FileNotFoundError(msg) FileNotFoundError: No SamTestRasterDataset data was found in root='C:/Users/win10/Downloads' with bands=['Banda 1', 'Banda 2', 'Banda 3']

Execution failed after 0.59 segundos

Cargando las capas resultantes Algoritmo 'Geo-SAM Image Encoder' finalizado

coolzhao commented 11 months ago

Hi @wilson733, just a quick feedback, I believe the problem is due to the complex file name pattern. The program fails to recognize the correct file name pattern. You can try to rename the file into a simpler name pattern, then try again, and I will try to fix this issue in a future release.

wilson733 commented 11 months ago

Great! work perfect, now i have to learn more about how to use better this tool. Thank you a lot!