Closed viennois closed 2 years ago
Hi, could you provide the full command line, with gdalinfo output for your input raster(s)? Wich version are you using ?
here, is the command line : otbcli_PatchesExtraction -source1.il mosaicOverLand_8bits_hillshade_nodata.tif -source1.patchsizex 16 -source1.patchsizey 16 -source1.out train_mosafinale17classes02032022_Patcheschgtdate_OL.tif -vec Train_Mosa2018_Hansen_Mask.shp -field "Num_class" -outlabels train_mosafinale17classes02032022_Labelschgtdate_OL.tif uint8
I used otbtf2.5:cpu
~~Could you please paste the output of gdalinfo for mosaicOverLand_8bits_hillshade_nodata.tif ? Thanks~~
I have a possible explanation, but not sure if it is the good one. Forget the gdal_info
output.
If you take a look in the otbTensorflowSampler
code, you can notice that the number of Geometries is counted, only when the geometry has a field "Num_class". However, when the patches are extracted, all geometries are walked (hence the count
could be greater than the geometries with "Num_class" field). This is a design flaw, and it will be corrected in future release. Still, this would imply that there is a missing "Num_class" field in some of the geometries of your "Train_Mosa2018_Hansen_Mask.shp" vector file.
Can you confirm that there are some undefined "Num_class" field for one or multiple geometries? (you can check that in QGIS
if you check the attributes table, you should see some NULL
value(s) in your "Num_class" field)
Yes, in the "Num_class" field, i have the Null Values So, i will replace this value by one
Fixed in the source code here.
We will draft a new release with docker images soon
thanks
I will wait our new docker images to classify my images
Hi When I run the command otbcli_PatchesExtraction, i have this error message : Sampling patches: 100% [**]2022-05-30 14:05:39 (FATAL) PatchesExtraction: itk::ERROR: Region ImageRegion (0x7fff99fb0650) Dimension: 2 Index: [0, 187216] Size: [16, 16] is outside of buffered region ImageRegion (0x55d38b9f0ef0) Dimension: 2 Index: [0, 0] Size: [16, 187216] Can you help me please ? Thanks Gaëlle