зеркало из https://github.com/microsoft/torchgeo.git
Allow more transforms
This commit is contained in:
Родитель
63b628db73
Коммит
a25e0e2238
|
@ -31,6 +31,8 @@ class VHR10(VisionDataset):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
root: str,
|
root: str,
|
||||||
|
transform: Optional[Callable[[Any], Any]] = None,
|
||||||
|
target_transform: Optional[Callable[[Any], Any]] = None,
|
||||||
transforms: Optional[Callable[[Any], Any]] = None,
|
transforms: Optional[Callable[[Any], Any]] = None,
|
||||||
download: bool = False,
|
download: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -38,11 +40,15 @@ class VHR10(VisionDataset):
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
root: root directory where dataset can be found
|
root: root directory where dataset can be found
|
||||||
|
transform: a function/transform that takes in a PIL image and returns a
|
||||||
|
transformed version
|
||||||
|
target_transform: a function/transform that takes in the target and
|
||||||
|
transforms it
|
||||||
transforms: a function/transform that takes input sample and its target as
|
transforms: a function/transform that takes input sample and its target as
|
||||||
entry and returns a transformed version
|
entry and returns a transformed version
|
||||||
download: if True, download dataset and store it in the root directory
|
download: if True, download dataset and store it in the root directory
|
||||||
"""
|
"""
|
||||||
super().__init__(root)
|
super().__init__(root, transforms, transform, target_transform)
|
||||||
|
|
||||||
if download:
|
if download:
|
||||||
self.download()
|
self.download()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче