Skip to content

Commit

Permalink
fix: remove output_image parameter in detect_from_image_tf
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Dec 11, 2024
1 parent c865091 commit c2d4082
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions robotoff/prediction/object_detection/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def __init__(self, config: ModelConfig):
def detect_from_image_tf(
self,
image: Image.Image,
output_image: bool = False,
triton_uri: str | None = None,
threshold: float = 0.5,
) -> ObjectDetectionResult:
Expand All @@ -139,8 +138,6 @@ def detect_from_image_tf(
API.
:param image: the input Pillow image
:param output_image: if True, the image with boxes and labels is
returned in the result
:param triton_uri: URI of the Triton Inference Server, defaults to
None. If not provided, the default value from settings is used.
:threshold: the minimum score for a detection to be considered,
Expand Down Expand Up @@ -218,10 +215,6 @@ def detect_from_image_tf(
detection_scores=detection_scores,
label_names=self.config.label_names,
)

if output_image:
add_boxes_and_labels(image_array, result)

return result

def detect_from_image_yolo(
Expand Down Expand Up @@ -267,9 +260,7 @@ def detect_from_image(
:return: the detection result
"""
if self.config.backend == "tf":
result = self.detect_from_image_tf(
image, output_image, triton_uri, threshold
)
result = self.detect_from_image_tf(image, triton_uri, threshold)

Check warning on line 263 in robotoff/prediction/object_detection/core.py

View check run for this annotation

Codecov / codecov/patch

robotoff/prediction/object_detection/core.py#L263

Added line #L263 was not covered by tests

elif self.config.backend == "yolo":
result = self.detect_from_image_yolo(
Expand Down

0 comments on commit c2d4082

Please sign in to comment.