@@ -27,7 +27,7 @@ class StereoMatchingDataset(ABC, VisionDataset):
27
27
28
28
_has_built_in_disparity_mask = False
29
29
30
- def __init__ (self , root : str , transforms : Optional [Callable ] = None ) -> None :
30
+ def __init__ (self , root : Union [ str , Path ] , transforms : Optional [Callable ] = None ) -> None :
31
31
"""
32
32
Args:
33
33
root(str): Root directory of the dataset.
@@ -159,11 +159,11 @@ class CarlaStereo(StereoMatchingDataset):
159
159
...
160
160
161
161
Args:
162
- root (string ): Root directory where `carla-highres` is located.
162
+ root (str or ``pathlib.Path`` ): Root directory where `carla-highres` is located.
163
163
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
164
164
"""
165
165
166
- def __init__ (self , root : str , transforms : Optional [Callable ] = None ) -> None :
166
+ def __init__ (self , root : Union [ str , Path ] , transforms : Optional [Callable ] = None ) -> None :
167
167
super ().__init__ (root , transforms )
168
168
169
169
root = Path (root ) / "carla-highres"
@@ -233,14 +233,14 @@ class Kitti2012Stereo(StereoMatchingDataset):
233
233
calib
234
234
235
235
Args:
236
- root (string ): Root directory where `Kitti2012` is located.
236
+ root (str or ``pathlib.Path`` ): Root directory where `Kitti2012` is located.
237
237
split (string, optional): The dataset split of scenes, either "train" (default) or "test".
238
238
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
239
239
"""
240
240
241
241
_has_built_in_disparity_mask = True
242
242
243
- def __init__ (self , root : str , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
243
+ def __init__ (self , root : Union [ str , Path ] , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
244
244
super ().__init__ (root , transforms )
245
245
246
246
verify_str_arg (split , "split" , valid_values = ("train" , "test" ))
@@ -321,14 +321,14 @@ class Kitti2015Stereo(StereoMatchingDataset):
321
321
calib
322
322
323
323
Args:
324
- root (string ): Root directory where `Kitti2015` is located.
324
+ root (str or ``pathlib.Path`` ): Root directory where `Kitti2015` is located.
325
325
split (string, optional): The dataset split of scenes, either "train" (default) or "test".
326
326
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
327
327
"""
328
328
329
329
_has_built_in_disparity_mask = True
330
330
331
- def __init__ (self , root : str , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
331
+ def __init__ (self , root : Union [ str , Path ] , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
332
332
super ().__init__ (root , transforms )
333
333
334
334
verify_str_arg (split , "split" , valid_values = ("train" , "test" ))
@@ -420,7 +420,7 @@ class Middlebury2014Stereo(StereoMatchingDataset):
420
420
...
421
421
422
422
Args:
423
- root (string ): Root directory of the Middleburry 2014 Dataset.
423
+ root (str or ``pathlib.Path`` ): Root directory of the Middleburry 2014 Dataset.
424
424
split (string, optional): The dataset split of scenes, either "train" (default), "test", or "additional"
425
425
use_ambient_views (boolean, optional): Whether to use different expose or lightning views when possible.
426
426
The dataset samples with equal probability between ``[im1.png, im1E.png, im1L.png]``.
@@ -480,7 +480,7 @@ class Middlebury2014Stereo(StereoMatchingDataset):
480
480
481
481
def __init__ (
482
482
self ,
483
- root : str ,
483
+ root : Union [ str , Path ] ,
484
484
split : str = "train" ,
485
485
calibration : Optional [str ] = "perfect" ,
486
486
use_ambient_views : bool = False ,
@@ -576,7 +576,7 @@ def _read_disparity(self, file_path: str) -> Union[Tuple[None, None], Tuple[np.n
576
576
valid_mask = (disparity_map > 0 ).squeeze (0 ) # mask out invalid disparities
577
577
return disparity_map , valid_mask
578
578
579
- def _download_dataset (self , root : str ) -> None :
579
+ def _download_dataset (self , root : Union [ str , Path ] ) -> None :
580
580
base_url = "https://vision.middlebury.edu/stereo/data/scenes2014/zip"
581
581
# train and additional splits have 2 different calibration settings
582
582
root = Path (root ) / "Middlebury2014"
@@ -675,7 +675,7 @@ class CREStereo(StereoMatchingDataset):
675
675
676
676
def __init__ (
677
677
self ,
678
- root : str ,
678
+ root : Union [ str , Path ] ,
679
679
transforms : Optional [Callable ] = None ,
680
680
) -> None :
681
681
super ().__init__ (root , transforms )
@@ -757,12 +757,12 @@ class FallingThingsStereo(StereoMatchingDataset):
757
757
...
758
758
759
759
Args:
760
- root (string ): Root directory where FallingThings is located.
760
+ root (str or ``pathlib.Path`` ): Root directory where FallingThings is located.
761
761
variant (string): Which variant to use. Either "single", "mixed", or "both".
762
762
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
763
763
"""
764
764
765
- def __init__ (self , root : str , variant : str = "single" , transforms : Optional [Callable ] = None ) -> None :
765
+ def __init__ (self , root : Union [ str , Path ] , variant : str = "single" , transforms : Optional [Callable ] = None ) -> None :
766
766
super ().__init__ (root , transforms )
767
767
768
768
root = Path (root ) / "FallingThings"
@@ -868,7 +868,7 @@ class SceneFlowStereo(StereoMatchingDataset):
868
868
...
869
869
870
870
Args:
871
- root (string ): Root directory where SceneFlow is located.
871
+ root (str or ``pathlib.Path`` ): Root directory where SceneFlow is located.
872
872
variant (string): Which dataset variant to user, "FlyingThings3D" (default), "Monkaa" or "Driving".
873
873
pass_name (string): Which pass to use, "clean" (default), "final" or "both".
874
874
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
@@ -877,7 +877,7 @@ class SceneFlowStereo(StereoMatchingDataset):
877
877
878
878
def __init__ (
879
879
self ,
880
- root : str ,
880
+ root : Union [ str , Path ] ,
881
881
variant : str = "FlyingThings3D" ,
882
882
pass_name : str = "clean" ,
883
883
transforms : Optional [Callable ] = None ,
@@ -973,14 +973,14 @@ class SintelStereo(StereoMatchingDataset):
973
973
...
974
974
975
975
Args:
976
- root (string ): Root directory where Sintel Stereo is located.
976
+ root (str or ``pathlib.Path`` ): Root directory where Sintel Stereo is located.
977
977
pass_name (string): The name of the pass to use, either "final", "clean" or "both".
978
978
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
979
979
"""
980
980
981
981
_has_built_in_disparity_mask = True
982
982
983
- def __init__ (self , root : str , pass_name : str = "final" , transforms : Optional [Callable ] = None ) -> None :
983
+ def __init__ (self , root : Union [ str , Path ] , pass_name : str = "final" , transforms : Optional [Callable ] = None ) -> None :
984
984
super ().__init__ (root , transforms )
985
985
986
986
verify_str_arg (pass_name , "pass_name" , valid_values = ("final" , "clean" , "both" ))
@@ -1082,12 +1082,12 @@ class InStereo2k(StereoMatchingDataset):
1082
1082
...
1083
1083
1084
1084
Args:
1085
- root (string ): Root directory where InStereo2k is located.
1085
+ root (str or ``pathlib.Path`` ): Root directory where InStereo2k is located.
1086
1086
split (string): Either "train" or "test".
1087
1087
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
1088
1088
"""
1089
1089
1090
- def __init__ (self , root : str , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
1090
+ def __init__ (self , root : Union [ str , Path ] , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
1091
1091
super ().__init__ (root , transforms )
1092
1092
1093
1093
root = Path (root ) / "InStereo2k" / split
@@ -1169,14 +1169,14 @@ class ETH3DStereo(StereoMatchingDataset):
1169
1169
...
1170
1170
1171
1171
Args:
1172
- root (string ): Root directory of the ETH3D Dataset.
1172
+ root (str or ``pathlib.Path`` ): Root directory of the ETH3D Dataset.
1173
1173
split (string, optional): The dataset split of scenes, either "train" (default) or "test".
1174
1174
transforms (callable, optional): A function/transform that takes in a sample and returns a transformed version.
1175
1175
"""
1176
1176
1177
1177
_has_built_in_disparity_mask = True
1178
1178
1179
- def __init__ (self , root : str , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
1179
+ def __init__ (self , root : Union [ str , Path ] , split : str = "train" , transforms : Optional [Callable ] = None ) -> None :
1180
1180
super ().__init__ (root , transforms )
1181
1181
1182
1182
verify_str_arg (split , "split" , valid_values = ("train" , "test" ))
0 commit comments