From 464af3ce113539d2fa4128e350d747e91a1594cc Mon Sep 17 00:00:00 2001 From: Max Tkachenko Date: Thu, 27 Nov 2025 03:58:01 +0300 Subject: [PATCH] Add max_det parameter to model prediction --- .../examples/yolo/control_models/rectangle_labels.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/label_studio_ml/examples/yolo/control_models/rectangle_labels.py b/label_studio_ml/examples/yolo/control_models/rectangle_labels.py index 035eb7d1..1c47754b 100644 --- a/label_studio_ml/examples/yolo/control_models/rectangle_labels.py +++ b/label_studio_ml/examples/yolo/control_models/rectangle_labels.py @@ -33,7 +33,8 @@ def is_control_matched(cls, control) -> bool: return control.tag == cls.type def predict_regions(self, path) -> List[Dict]: - results = self.model.predict(path) + max_det = int(self.control.attr.get("model_max_det", 300)) + results = self.model.predict(path, max_det=max_det) self.debug_plot(results[0].plot()) # oriented bounding boxes are detected, but it should be processed by RectangleLabelsObbModel