ALOSDataset
¶
ALOSDataset(
volpath: str = None,
transform=None,
crop_coordinates: tuple = None,
patch_size: tuple = (128, 128),
patch_stride: tuple = None,
)
Bases: Dataset
ALOSDataset
The format is described in https://www.eorc.jaxa.jp/ALOS/en/alos-2/pdf/product_format_description/PALSAR-2_xx_Format_CEOS_E_g.pdf
The dataset is constructed from the volume file. If leader and trailer files are colocated, they are loaded as well.
Important, this code has been developed for working with L1.1 HBQ-R Quad Pol datafiles. It is not expected to work out of the box for other levels and for less than 4 polarizations.
Parameters:
-
volpath
(str
, default:None
) –the path to the VOLUME file
-
transform
–the transform applied the cropped image. It applies on a dictionnary of patches {'HH': np.array, 'HV': np.array}
-
crop_coordinates
(tuple
, default:None
) –the subpart of the image to consider as ((row_i, col_i), (row_j, col_j)) defining the corner coordinates
-
patch_size
(tuple
, default:(128, 128)
) –the dimensions of the patches to consider (rows, cols)
-
patch_stride
(tuple
, default:None
) –the shift between two consecutive patches, default:patch_size
Source code in src/torchcvnn/datasets/alos2/dataset.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
__getitem__
¶
__getitem__(idx: int)
Access and returns the subpatch specified by the index
Parameters:
-
idx
(int
) –the index of the patch to access
Source code in src/torchcvnn/datasets/alos2/dataset.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
__len__
¶
__len__() -> int
Returns the length of the dataset according to the patch size, stride and image size
Returns:
-
int
(int
) –the total number of available patches
Source code in src/torchcvnn/datasets/alos2/dataset.py
137 138 139 140 141 142 143 144 145 146 |
|