changes w.r.t review

This commit is contained in:
yaswant19 2025-07-01 22:17:38 +05:30
parent 03615b2304
commit fb5a27b1bf
3 changed files with 8 additions and 1 deletions

View File

@ -858,6 +858,7 @@ 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]

View File

@ -522,6 +522,7 @@ class EomtImageProcessorFast(BaseImageProcessorFast):
):
"""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

View File

@ -474,4 +474,9 @@ class EomtForUniversalSegmentationIntegrationTest(unittest.TestCase):
image = Image.open(requests.get("http://images.cocodataset.org/val2017/000000039769.jpg", stream=True).raw)
pipe = pipeline(model=self.model_id, subtask="panoptic", device=torch_device)
_ = pipe(image)
output = pipe(image)
EXPECTED_OUTPUT_LABELS = ["LABEL_15", "LABEL_15", "LABEL_57", "LABEL_65", "LABEL_65"]
output_labels = [segment["label"] for segment in output["segments_info"]]
self.assertEqual(output_labels, EXPECTED_OUTPUT_LABELS)