From ffc3fda6f0e42a5a751e23a6bc3e881cff9109b9 Mon Sep 17 00:00:00 2001 From: Evening Date: Wed, 14 Feb 2024 15:04:14 +0800 Subject: [PATCH] Resolve preset conflict --- src/frdc/load/preset.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/frdc/load/preset.py b/src/frdc/load/preset.py index 4f892349..86e9d520 100644 --- a/src/frdc/load/preset.py +++ b/src/frdc/load/preset.py @@ -50,12 +50,16 @@ def __call__( transform: Callable[[list[np.ndarray]], Any] = None, target_transform: Callable[[list[str]], list[str]] = None, use_legacy_bounds: bool = False, + polycrop: bool = False, + polycrop_value: Any = np.nan, ): """Alias for labelled().""" return self.labelled( transform, target_transform, - use_legacy_bounds, + use_legacy_bounds=use_legacy_bounds, + polycrop=polycrop, + polycrop_value=polycrop_value, ) def labelled( @@ -63,6 +67,8 @@ def labelled( transform: Callable[[list[np.ndarray]], Any] = None, target_transform: Callable[[list[str]], list[str]] = None, use_legacy_bounds: bool = False, + polycrop: bool = False, + polycrop_value: Any = np.nan, ): """Returns the Labelled Dataset.""" return FRDCDataset( @@ -71,7 +77,9 @@ def labelled( self.version, transform, target_transform, - use_legacy_bounds, + use_legacy_bounds=use_legacy_bounds, + polycrop=polycrop, + polycrop_value=polycrop_value, ) def unlabelled( @@ -79,6 +87,8 @@ def unlabelled( transform: Callable[[list[np.ndarray]], Any] = None, target_transform: Callable[[list[str]], list[str]] = None, use_legacy_bounds: bool = False, + polycrop: bool = False, + polycrop_value: Any = np.nan, ): """Returns the Unlabelled Dataset. @@ -93,7 +103,9 @@ def unlabelled( self.version, transform, target_transform, - use_legacy_bounds, + use_legacy_bounds=use_legacy_bounds, + polycrop=polycrop, + polycrop_value=polycrop_value, )