Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove output_image parameter in detect_from_image_tf #1494

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 @@
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 @@
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 @@
: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
Loading