Add Optional to remaining types (#37808)

More Optional typing

Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
Yuanyuan Chen
2025-04-28 21:20:45 +08:00
committed by GitHub
parent 1a9188a54e
commit da4ff2a5f5
206 changed files with 553 additions and 531 deletions

View File

@@ -755,7 +755,7 @@ class BaseImageProcessorFast(BaseImageProcessor):
class SemanticSegmentationMixin:
def post_process_semantic_segmentation(self, outputs, target_sizes: list[tuple] = None):
def post_process_semantic_segmentation(self, outputs, target_sizes: Optional[list[tuple]] = None):
"""
Converts the output of [`MobileNetV2ForSemanticSegmentation`] into semantic segmentation maps. Only supports PyTorch.