mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 13:20:12 +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."""
|
"""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
|
size = size if size is not None else self.size
|
||||||
|
|
||||||
masks_queries_logits = outputs.masks_queries_logits # [batch_size, num_queries, height, width]
|
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})
|
results.append({"segmentation": segmentation, "segments_info": segments})
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@filter_out_non_signature_kwargs()
|
||||||
def post_process_instance_segmentation(
|
def post_process_instance_segmentation(
|
||||||
self,
|
self,
|
||||||
outputs,
|
outputs,
|
||||||
target_sizes: list[tuple[int, int]],
|
target_sizes: list[tuple[int, int]],
|
||||||
threshold: float = 0.5,
|
threshold: float = 0.5,
|
||||||
mask_threshold: float = 0.5,
|
|
||||||
overlap_mask_area_threshold: float = 0.8,
|
|
||||||
size: Optional[dict[str, int]] = None,
|
size: Optional[dict[str, int]] = None,
|
||||||
):
|
):
|
||||||
"""Post-processes model outputs into Instance Segmentation Predictions."""
|
"""Post-processes model outputs into Instance Segmentation Predictions."""
|
||||||
|
@ -41,6 +41,7 @@ from ...processing_utils import Unpack
|
|||||||
from ...utils import (
|
from ...utils import (
|
||||||
TensorType,
|
TensorType,
|
||||||
auto_docstring,
|
auto_docstring,
|
||||||
|
filter_out_non_signature_kwargs,
|
||||||
is_torch_available,
|
is_torch_available,
|
||||||
is_torchvision_available,
|
is_torchvision_available,
|
||||||
is_torchvision_v2_available,
|
is_torchvision_v2_available,
|
||||||
@ -511,18 +512,16 @@ class EomtImageProcessorFast(BaseImageProcessorFast):
|
|||||||
results.append({"segmentation": segmentation, "segments_info": segments})
|
results.append({"segmentation": segmentation, "segments_info": segments})
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
@filter_out_non_signature_kwargs()
|
||||||
def post_process_instance_segmentation(
|
def post_process_instance_segmentation(
|
||||||
self,
|
self,
|
||||||
outputs,
|
outputs,
|
||||||
target_sizes: list[tuple[int, int]],
|
target_sizes: list[tuple[int, int]],
|
||||||
threshold: float = 0.8,
|
threshold: float = 0.8,
|
||||||
mask_threshold: float = 0.5,
|
|
||||||
overlap_mask_area_threshold: float = 0.8,
|
|
||||||
size: Optional[dict[str, int]] = None,
|
size: Optional[dict[str, int]] = None,
|
||||||
):
|
):
|
||||||
"""Post-processes model outputs into Instance Segmentation Predictions."""
|
"""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
|
size = size if size is not None else self.size
|
||||||
|
|
||||||
masks_queries_logits = outputs.masks_queries_logits
|
masks_queries_logits = outputs.masks_queries_logits
|
||||||
|
Loading…
Reference in New Issue
Block a user