mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 21:00:08 +06:00
use decorator
This commit is contained in:
parent
e0a0381631
commit
ec29b730ec
@ -858,7 +858,6 @@ class EomtImageProcessor(BaseImageProcessor):
|
||||
):
|
||||
"""Post-processes model outputs into final panoptic segmentation prediction."""
|
||||
|
||||
# `mask_threshold` and `overlap_mask_area_threshold` args are unused and only present for Pipeline compatability.
|
||||
size = size if size is not None else self.size
|
||||
|
||||
masks_queries_logits = outputs.masks_queries_logits # [batch_size, num_queries, height, width]
|
||||
@ -904,13 +903,12 @@ class EomtImageProcessor(BaseImageProcessor):
|
||||
results.append({"segmentation": segmentation, "segments_info": segments})
|
||||
return results
|
||||
|
||||
@filter_out_non_signature_kwargs()
|
||||
def post_process_instance_segmentation(
|
||||
self,
|
||||
outputs,
|
||||
target_sizes: list[tuple[int, int]],
|
||||
threshold: float = 0.5,
|
||||
mask_threshold: float = 0.5,
|
||||
overlap_mask_area_threshold: float = 0.8,
|
||||
size: Optional[dict[str, int]] = None,
|
||||
):
|
||||
"""Post-processes model outputs into Instance Segmentation Predictions."""
|
||||
|
@ -41,6 +41,7 @@ from ...processing_utils import Unpack
|
||||
from ...utils import (
|
||||
TensorType,
|
||||
auto_docstring,
|
||||
filter_out_non_signature_kwargs,
|
||||
is_torch_available,
|
||||
is_torchvision_available,
|
||||
is_torchvision_v2_available,
|
||||
@ -511,18 +512,16 @@ class EomtImageProcessorFast(BaseImageProcessorFast):
|
||||
results.append({"segmentation": segmentation, "segments_info": segments})
|
||||
return results
|
||||
|
||||
@filter_out_non_signature_kwargs()
|
||||
def post_process_instance_segmentation(
|
||||
self,
|
||||
outputs,
|
||||
target_sizes: list[tuple[int, int]],
|
||||
threshold: float = 0.8,
|
||||
mask_threshold: float = 0.5,
|
||||
overlap_mask_area_threshold: float = 0.8,
|
||||
size: Optional[dict[str, int]] = None,
|
||||
):
|
||||
"""Post-processes model outputs into Instance Segmentation Predictions."""
|
||||
|
||||
# `mask_threshold` and `overlap_mask_area_threshold` args are unused and only present for Pipeline compatability.
|
||||
size = size if size is not None else self.size
|
||||
|
||||
masks_queries_logits = outputs.masks_queries_logits
|
||||
|
Loading…
Reference in New Issue
Block a user