Unverified Commit 354ea443 authored by amyeroberts's avatar amyeroberts Committed by GitHub
Browse files

Replace reduce_labels with do_reduce_labels (#21218)

* Replace reduce_labels with do_reduce_labels

* Replace only for __init__ and preprocess

* Update tests
parent 1eda4a41
...@@ -373,7 +373,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -373,7 +373,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
ignore_index (`int`, *optional*): ignore_index (`int`, *optional*):
Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels
denoted with 0 (background) will be replaced with `ignore_index`. denoted with 0 (background) will be replaced with `ignore_index`.
reduce_labels (`bool`, *optional*, defaults to `False`): do_reduce_labels (`bool`, *optional*, defaults to `False`):
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0 Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by `ignore_index`. The background label will be replaced by `ignore_index`.
...@@ -394,7 +394,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -394,7 +394,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
image_mean: Union[float, List[float]] = None, image_mean: Union[float, List[float]] = None,
image_std: Union[float, List[float]] = None, image_std: Union[float, List[float]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: bool = False, do_reduce_labels: bool = False,
**kwargs **kwargs
): ):
if "size_divisibility" in kwargs: if "size_divisibility" in kwargs:
...@@ -415,6 +415,13 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -415,6 +415,13 @@ class MaskFormerImageProcessor(BaseImageProcessor):
self._max_size = kwargs.pop("max_size") self._max_size = kwargs.pop("max_size")
else: else:
self._max_size = 1333 self._max_size = 1333
if "reduce_labels" in kwargs:
warnings.warn(
"The `reduce_labels` argument is deprecated and will be removed in v4.27. Please use "
"`do_reduce_labels` instead.",
FutureWarning,
)
do_reduce_labels = kwargs.pop("reduce_labels")
size = size if size is not None else {"shortest_edge": 800, "longest_edge": self._max_size} size = size if size is not None else {"shortest_edge": 800, "longest_edge": self._max_size}
size = get_size_dict(size, max_size=self._max_size, default_to_square=False) size = get_size_dict(size, max_size=self._max_size, default_to_square=False)
...@@ -430,7 +437,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -430,7 +437,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
self.image_mean = image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN self.image_mean = image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN
self.image_std = image_std if image_std is not None else IMAGENET_DEFAULT_STD self.image_std = image_std if image_std is not None else IMAGENET_DEFAULT_STD
self.ignore_index = ignore_index self.ignore_index = ignore_index
self.reduce_labels = reduce_labels self.do_reduce_labels = do_reduce_labels
@classmethod @classmethod
def from_dict(cls, image_processor_dict: Dict[str, Any], **kwargs): def from_dict(cls, image_processor_dict: Dict[str, Any], **kwargs):
...@@ -463,6 +470,15 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -463,6 +470,15 @@ class MaskFormerImageProcessor(BaseImageProcessor):
) )
return self.size["longest_edge"] return self.size["longest_edge"]
@property
def reduce_labels(self):
warnings.warn(
"The `reduce_labels` property is deprecated and will be removed in v4.27. Please use "
"`do_reduce_labels` instead.",
FutureWarning,
)
return self.do_reduce_labels
def resize( def resize(
self, self,
image: np.ndarray, image: np.ndarray,
...@@ -532,6 +548,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -532,6 +548,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
instance_id_to_semantic_id: Optional[Dict[int, int]] = None, instance_id_to_semantic_id: Optional[Dict[int, int]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: bool = False, reduce_labels: bool = False,
**kwargs
): ):
reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels
ignore_index = ignore_index if ignore_index is not None else self.ignore_index ignore_index = ignore_index if ignore_index is not None else self.ignore_index
...@@ -645,16 +662,26 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -645,16 +662,26 @@ class MaskFormerImageProcessor(BaseImageProcessor):
image_mean: Optional[Union[float, List[float]]] = None, image_mean: Optional[Union[float, List[float]]] = None,
image_std: Optional[Union[float, List[float]]] = None, image_std: Optional[Union[float, List[float]]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: Optional[bool] = None, do_reduce_labels: Optional[bool] = None,
return_tensors: Optional[Union[str, TensorType]] = None, return_tensors: Optional[Union[str, TensorType]] = None,
data_format: Union[str, ChannelDimension] = ChannelDimension.FIRST, data_format: Union[str, ChannelDimension] = ChannelDimension.FIRST,
**kwargs **kwargs
) -> BatchFeature: ) -> BatchFeature:
if "pad_and_return_pixel_mask" in kwargs: if "pad_and_return_pixel_mask" in kwargs:
warnings.warn( warnings.warn(
"The `pad_and_return_pixel_mask` argument is deprecated and will be removed in a future version", "The `pad_and_return_pixel_mask` argument is deprecated and will be removed in v4.27",
FutureWarning, FutureWarning,
) )
if "reduce_labels" in kwargs:
warnings.warn(
"The `reduce_labels` argument is deprecated and will be removed in v4.27. Please use"
" `do_reduce_labels` instead.",
FutureWarning,
)
if do_reduce_labels is not None:
raise ValueError(
"Cannot use both `reduce_labels` and `do_reduce_labels`. Please use `do_reduce_labels` instead."
)
do_resize = do_resize if do_resize is not None else self.do_resize do_resize = do_resize if do_resize is not None else self.do_resize
size = size if size is not None else self.size size = size if size is not None else self.size
...@@ -667,7 +694,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -667,7 +694,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
image_mean = image_mean if image_mean is not None else self.image_mean image_mean = image_mean if image_mean is not None else self.image_mean
image_std = image_std if image_std is not None else self.image_std image_std = image_std if image_std is not None else self.image_std
ignore_index = ignore_index if ignore_index is not None else self.ignore_index ignore_index = ignore_index if ignore_index is not None else self.ignore_index
reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels do_reduce_labels = do_reduce_labels if do_reduce_labels is not None else self.do_reduce_labels
if do_resize is not None and size is None or size_divisor is None: if do_resize is not None and size is None or size_divisor is None:
raise ValueError("If `do_resize` is True, `size` and `size_divisor` must be provided.") raise ValueError("If `do_resize` is True, `size` and `size_divisor` must be provided.")
...@@ -720,7 +747,7 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -720,7 +747,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
for segmentation_map in segmentation_maps for segmentation_map in segmentation_maps
] ]
encoded_inputs = self.encode_inputs( encoded_inputs = self.encode_inputs(
images, segmentation_maps, instance_id_to_semantic_id, ignore_index, reduce_labels, return_tensors images, segmentation_maps, instance_id_to_semantic_id, ignore_index, do_reduce_labels, return_tensors
) )
return encoded_inputs return encoded_inputs
...@@ -842,13 +869,12 @@ class MaskFormerImageProcessor(BaseImageProcessor): ...@@ -842,13 +869,12 @@ class MaskFormerImageProcessor(BaseImageProcessor):
`annotations` are provided). They identify the labels of `mask_labels`, e.g. the label of `annotations` are provided). They identify the labels of `mask_labels`, e.g. the label of
`mask_labels[i][j]` if `class_labels[i][j]`. `mask_labels[i][j]` if `class_labels[i][j]`.
""" """
ignore_index = self.ignore_index if ignore_index is None else ignore_index
reduce_labels = self.reduce_labels if reduce_labels is None else reduce_labels
if "pad_and_return_pixel_mask" in kwargs: if "pad_and_return_pixel_mask" in kwargs:
warnings.warn( warnings.warn(
"The `pad_and_return_pixel_mask` argument has no effect and will be removed in v4.27", FutureWarning "The `pad_and_return_pixel_mask` argument has no effect and will be removed in v4.27", FutureWarning
) )
ignore_index = self.ignore_index if ignore_index is None else ignore_index
reduce_labels = self.do_reduce_labels if reduce_labels is None else reduce_labels
pixel_values_list = [to_numpy_array(pixel_values) for pixel_values in pixel_values_list] pixel_values_list = [to_numpy_array(pixel_values) for pixel_values in pixel_values_list]
encoded_inputs = self.pad(pixel_values_list, return_tensors=return_tensors) encoded_inputs = self.pad(pixel_values_list, return_tensors=return_tensors)
......
...@@ -373,7 +373,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -373,7 +373,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
ignore_index (`int`, *optional*): ignore_index (`int`, *optional*):
Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels Label to be assigned to background pixels in segmentation maps. If provided, segmentation map pixels
denoted with 0 (background) will be replaced with `ignore_index`. denoted with 0 (background) will be replaced with `ignore_index`.
reduce_labels (`bool`, *optional*, defaults to `False`): do_reduce_labels (`bool`, *optional*, defaults to `False`):
Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0 Whether or not to decrement all label values of segmentation maps by 1. Usually used for datasets where 0
is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). is used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k).
The background label will be replaced by `ignore_index`. The background label will be replaced by `ignore_index`.
...@@ -399,7 +399,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -399,7 +399,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
image_mean: Union[float, List[float]] = None, image_mean: Union[float, List[float]] = None,
image_std: Union[float, List[float]] = None, image_std: Union[float, List[float]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: bool = False, do_reduce_labels: bool = False,
repo_path: str = "shi-labs/oneformer_demo", repo_path: str = "shi-labs/oneformer_demo",
class_info_file: str = None, class_info_file: str = None,
num_text: Optional[int] = None, num_text: Optional[int] = None,
...@@ -413,6 +413,14 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -413,6 +413,14 @@ class OneFormerImageProcessor(BaseImageProcessor):
size = size if size is not None else {"shortest_edge": 800, "longest_edge": self._max_size} size = size if size is not None else {"shortest_edge": 800, "longest_edge": self._max_size}
size = get_size_dict(size, max_size=self._max_size, default_to_square=False) size = get_size_dict(size, max_size=self._max_size, default_to_square=False)
if "reduce_labels" in kwargs:
warnings.warn(
"The `reduce_labels` argument is deprecated and will be removed in v4.27. "
"Please use `do_reduce_labels` instead.",
FutureWarning,
)
do_reduce_labels = kwargs.pop("reduce_labels")
super().__init__(**kwargs) super().__init__(**kwargs)
self.do_resize = do_resize self.do_resize = do_resize
self.size = size self.size = size
...@@ -423,7 +431,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -423,7 +431,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
self.image_mean = image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN self.image_mean = image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN
self.image_std = image_std if image_std is not None else IMAGENET_DEFAULT_STD self.image_std = image_std if image_std is not None else IMAGENET_DEFAULT_STD
self.ignore_index = ignore_index self.ignore_index = ignore_index
self.reduce_labels = reduce_labels self.do_reduce_labels = do_reduce_labels
self.class_info_file = class_info_file self.class_info_file = class_info_file
self.repo_path = repo_path self.repo_path = repo_path
self.metadata = prepare_metadata(repo_path, class_info_file) self.metadata = prepare_metadata(repo_path, class_info_file)
...@@ -499,6 +507,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -499,6 +507,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
instance_id_to_semantic_id: Optional[Dict[int, int]] = None, instance_id_to_semantic_id: Optional[Dict[int, int]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: bool = False, reduce_labels: bool = False,
**kwargs
): ):
reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels
ignore_index = ignore_index if ignore_index is not None else self.ignore_index ignore_index = ignore_index if ignore_index is not None else self.ignore_index
...@@ -607,16 +616,28 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -607,16 +616,28 @@ class OneFormerImageProcessor(BaseImageProcessor):
image_mean: Optional[Union[float, List[float]]] = None, image_mean: Optional[Union[float, List[float]]] = None,
image_std: Optional[Union[float, List[float]]] = None, image_std: Optional[Union[float, List[float]]] = None,
ignore_index: Optional[int] = None, ignore_index: Optional[int] = None,
reduce_labels: Optional[bool] = None, do_reduce_labels: Optional[bool] = None,
return_tensors: Optional[Union[str, TensorType]] = None, return_tensors: Optional[Union[str, TensorType]] = None,
data_format: Union[str, ChannelDimension] = ChannelDimension.FIRST, data_format: Union[str, ChannelDimension] = ChannelDimension.FIRST,
**kwargs **kwargs
) -> BatchFeature: ) -> BatchFeature:
if "pad_and_return_pixel_mask" in kwargs: if "pad_and_return_pixel_mask" in kwargs:
warnings.warn( warnings.warn(
"The `pad_and_return_pixel_mask` argument is deprecated and will be removed in a future version", "The `pad_and_return_pixel_mask` argument is deprecated and will be removed in v4.27",
FutureWarning, FutureWarning,
) )
if "reduce_labels" in kwargs:
warnings.warn(
"The `reduce_labels` argument is deprecated and will be removed in a v4.27. Please use"
" `do_reduce_labels` instead.",
FutureWarning,
)
if do_reduce_labels is not None:
raise ValueError(
"You cannot use both `reduce_labels` and `do_reduce_labels` arguments. Please use"
" `do_reduce_labels` instead."
)
do_reduce_labels = kwargs.pop("reduce_labels")
do_resize = do_resize if do_resize is not None else self.do_resize do_resize = do_resize if do_resize is not None else self.do_resize
size = size if size is not None else self.size size = size if size is not None else self.size
...@@ -628,7 +649,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -628,7 +649,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
image_mean = image_mean if image_mean is not None else self.image_mean image_mean = image_mean if image_mean is not None else self.image_mean
image_std = image_std if image_std is not None else self.image_std image_std = image_std if image_std is not None else self.image_std
ignore_index = ignore_index if ignore_index is not None else self.ignore_index ignore_index = ignore_index if ignore_index is not None else self.ignore_index
reduce_labels = reduce_labels if reduce_labels is not None else self.reduce_labels do_reduce_labels = do_reduce_labels if do_reduce_labels is not None else self.do_reduce_labels
if do_resize is not None and size is None: if do_resize is not None and size is None:
raise ValueError("If `do_resize` is True, `size` must be provided.") raise ValueError("If `do_resize` is True, `size` must be provided.")
...@@ -684,7 +705,7 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -684,7 +705,7 @@ class OneFormerImageProcessor(BaseImageProcessor):
segmentation_maps, segmentation_maps,
instance_id_to_semantic_id, instance_id_to_semantic_id,
ignore_index, ignore_index,
reduce_labels, do_reduce_labels,
return_tensors, return_tensors,
) )
return encoded_inputs return encoded_inputs
...@@ -910,14 +931,13 @@ class OneFormerImageProcessor(BaseImageProcessor): ...@@ -910,14 +931,13 @@ class OneFormerImageProcessor(BaseImageProcessor):
- **text_inputs** -- Optional list of text string entries to be fed to a model (when `annotations` are - **text_inputs** -- Optional list of text string entries to be fed to a model (when `annotations` are
provided). They identify the binary masks present in the image. provided). They identify the binary masks present in the image.
""" """
ignore_index = self.ignore_index if ignore_index is None else ignore_index
reduce_labels = self.reduce_labels if reduce_labels is None else reduce_labels
if "pad_and_return_pixel_mask" in kwargs: if "pad_and_return_pixel_mask" in kwargs:
warnings.warn( warnings.warn(
"The `pad_and_return_pixel_mask` argument has no effect and will be removed in v4.27", FutureWarning "The `pad_and_return_pixel_mask` argument has no effect and will be removed in v4.27", FutureWarning
) )
ignore_index = self.ignore_index if ignore_index is None else ignore_index
reduce_labels = self.do_reduce_labels if reduce_labels is None else reduce_labels
pixel_values_list = [to_numpy_array(pixel_values) for pixel_values in pixel_values_list] pixel_values_list = [to_numpy_array(pixel_values) for pixel_values in pixel_values_list]
pad_size = get_max_height_width(pixel_values_list) pad_size = get_max_height_width(pixel_values_list)
encoded_inputs = self.pad(pixel_values_list, return_tensors=return_tensors) encoded_inputs = self.pad(pixel_values_list, return_tensors=return_tensors)
......
...@@ -122,8 +122,8 @@ class SegformerImageProcessor(BaseImageProcessor): ...@@ -122,8 +122,8 @@ class SegformerImageProcessor(BaseImageProcessor):
@classmethod @classmethod
def from_dict(cls, image_processor_dict: Dict[str, Any], **kwargs): def from_dict(cls, image_processor_dict: Dict[str, Any], **kwargs):
""" """
Overrides the `from_dict` method from the base class to make sure `reduce_labels` is updated if image processor Overrides the `from_dict` method from the base class to make sure `do_reduce_labels` is updated if image
is created using from_dict and kwargs e.g. `SegformerImageProcessor.from_pretrained(checkpoint, processor is created using from_dict and kwargs e.g. `SegformerImageProcessor.from_pretrained(checkpoint,
reduce_labels=True)` reduce_labels=True)`
""" """
image_processor_dict = image_processor_dict.copy() image_processor_dict = image_processor_dict.copy()
......
...@@ -53,7 +53,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase): ...@@ -53,7 +53,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase):
image_mean=[0.5, 0.5, 0.5], image_mean=[0.5, 0.5, 0.5],
image_std=[0.5, 0.5, 0.5], image_std=[0.5, 0.5, 0.5],
num_labels=10, num_labels=10,
reduce_labels=True, do_reduce_labels=True,
ignore_index=255, ignore_index=255,
): ):
self.parent = parent self.parent = parent
...@@ -74,7 +74,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase): ...@@ -74,7 +74,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase):
self.height = 3 self.height = 3
self.width = 4 self.width = 4
self.num_labels = num_labels self.num_labels = num_labels
self.reduce_labels = reduce_labels self.do_reduce_labels = do_reduce_labels
self.ignore_index = ignore_index self.ignore_index = ignore_index
def prepare_feat_extract_dict(self): def prepare_feat_extract_dict(self):
...@@ -86,7 +86,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase): ...@@ -86,7 +86,7 @@ class MaskFormerFeatureExtractionTester(unittest.TestCase):
"image_std": self.image_std, "image_std": self.image_std,
"size_divisor": self.size_divisor, "size_divisor": self.size_divisor,
"num_labels": self.num_labels, "num_labels": self.num_labels,
"reduce_labels": self.reduce_labels, "do_reduce_labels": self.do_reduce_labels,
"ignore_index": self.ignore_index, "ignore_index": self.ignore_index,
} }
......
...@@ -69,7 +69,7 @@ class OneFormerImageProcessorTester(unittest.TestCase): ...@@ -69,7 +69,7 @@ class OneFormerImageProcessorTester(unittest.TestCase):
image_mean=[0.5, 0.5, 0.5], image_mean=[0.5, 0.5, 0.5],
image_std=[0.5, 0.5, 0.5], image_std=[0.5, 0.5, 0.5],
num_labels=10, num_labels=10,
reduce_labels=False, do_reduce_labels=False,
ignore_index=255, ignore_index=255,
repo_path="shi-labs/oneformer_demo", repo_path="shi-labs/oneformer_demo",
class_info_file="ade20k_panoptic.json", class_info_file="ade20k_panoptic.json",
...@@ -97,7 +97,7 @@ class OneFormerImageProcessorTester(unittest.TestCase): ...@@ -97,7 +97,7 @@ class OneFormerImageProcessorTester(unittest.TestCase):
self.height = 3 self.height = 3
self.width = 4 self.width = 4
self.num_labels = num_labels self.num_labels = num_labels
self.reduce_labels = reduce_labels self.do_reduce_labels = do_reduce_labels
self.ignore_index = ignore_index self.ignore_index = ignore_index
def prepare_feat_extract_dict(self): def prepare_feat_extract_dict(self):
...@@ -108,7 +108,7 @@ class OneFormerImageProcessorTester(unittest.TestCase): ...@@ -108,7 +108,7 @@ class OneFormerImageProcessorTester(unittest.TestCase):
"image_mean": self.image_mean, "image_mean": self.image_mean,
"image_std": self.image_std, "image_std": self.image_std,
"num_labels": self.num_labels, "num_labels": self.num_labels,
"reduce_labels": self.reduce_labels, "do_reduce_labels": self.do_reduce_labels,
"ignore_index": self.ignore_index, "ignore_index": self.ignore_index,
"class_info_file": self.class_info_file, "class_info_file": self.class_info_file,
"metadata": self.metadata, "metadata": self.metadata,
...@@ -180,7 +180,7 @@ class OneFormerImageProcessingTest(FeatureExtractionSavingTestMixin, unittest.Te ...@@ -180,7 +180,7 @@ class OneFormerImageProcessingTest(FeatureExtractionSavingTestMixin, unittest.Te
self.assertTrue(hasattr(image_processor, "num_text")) self.assertTrue(hasattr(image_processor, "num_text"))
self.assertTrue(hasattr(image_processor, "repo_path")) self.assertTrue(hasattr(image_processor, "repo_path"))
self.assertTrue(hasattr(image_processor, "metadata")) self.assertTrue(hasattr(image_processor, "metadata"))
self.assertTrue(hasattr(image_processor, "reduce_labels")) self.assertTrue(hasattr(image_processor, "do_reduce_labels"))
def test_batch_feature(self): def test_batch_feature(self):
pass pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment