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'm trying to load a custom DSM raster dataset of type float32.
I'm implementing a new class based on RasterDataset like so:
from torchgeo.datasets import RasterDataset
class DsmData(RasterDataset):
filename_glob = "*.tif"
When I call __getitem__() on a DsmData object, I get an array containing int32 data instead.
I traced this down to the following line in the RasterDataset definition
All raster datasets are forced into the int32 type which should not happen.
Having RasterDatasets with different types will probably cause problems when applying union or intersection operations.
But since a custom collate_fn can be defined, the user is able to provide a solution for this.
I achieved the desired behavior simply by removing the mentioned line.
The text was updated successfully, but these errors were encountered:
I'm trying to load a custom DSM raster dataset of type float32.
I'm implementing a new class based on RasterDataset like so:
When I call
__getitem__()
on a DsmData object, I get an array containing int32 data instead.I traced this down to the following line in the RasterDataset definition
torchgeo/torchgeo/datasets/geo.py
Line 464 in 3f7e525
All raster datasets are forced into the int32 type which should not happen.
Having RasterDatasets with different types will probably cause problems when applying union or intersection operations.
But since a custom
collate_fn
can be defined, the user is able to provide a solution for this.I achieved the desired behavior simply by removing the mentioned line.
The text was updated successfully, but these errors were encountered: