@@ -631,79 +631,6 @@ def update_detector_name(self, detector: Union[str, Detector], name: str) -> Non
631631 detector = detector .id
632632 self .detectors_api .update_detector (detector , patched_detector_request = PatchedDetectorRequest (name = name ))
633633
634- def create_bounding_box_detector ( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
635- self ,
636- name : str ,
637- query : str ,
638- class_name : str ,
639- * ,
640- max_num_bboxes : Optional [int ] = None ,
641- group_name : Optional [str ] = None ,
642- confidence_threshold : Optional [float ] = None ,
643- patience_time : Optional [float ] = None ,
644- pipeline_config : Optional [str ] = None ,
645- metadata : Union [dict , str , None ] = None ,
646- priming_group_id : Optional [str ] = None ,
647- ) -> Detector :
648- """
649- Creates a bounding box detector that can detect objects in images up to a specified maximum number of bounding
650- boxes.
651-
652- This method is now available in the base Groundlight class and is maintained here for backward compatibility.
653-
654- **Example usage**::
655-
656- gl = ExperimentalApi()
657-
658- # Create a detector that counts people up to 5
659- detector = gl.create_bounding_box_detector(
660- name="people_counter",
661- query="Draw a bounding box around each person in the image",
662- class_name="person",
663- max_num_bboxes=5,
664- confidence_threshold=0.9,
665- patience_time=30.0
666- )
667-
668- # Use the detector to find people in an image
669- image_query = gl.ask_ml(detector, "path/to/image.jpg")
670- print(f"Confidence: {image_query.result.confidence}")
671- print(f"Label: {image_query.result.label}")
672- print(f"Bounding boxes: {image_query.rois}")
673-
674- :param name: A short, descriptive name for the detector.
675- :param query: A question about the object to detect in the image.
676- :param class_name: The class name of the object to detect.
677- :param max_num_bboxes: Maximum number of bounding boxes to detect (default: 10)
678- :param group_name: Optional name of a group to organize related detectors together.
679- :param confidence_threshold: A value that sets the minimum confidence level required for the ML model's
680- predictions. If confidence is below this threshold, the query may be sent for human review.
681- :param patience_time: The maximum time in seconds that Groundlight will attempt to generate a
682- confident prediction before falling back to human review. Defaults to 30 seconds.
683- :param pipeline_config: Advanced usage only. Configuration string needed to instantiate a specific
684- prediction pipeline for this detector.
685- :param metadata: A dictionary or JSON string containing custom key/value pairs to associate with
686- the detector (limited to 1KB). This metadata can be used to store additional
687- information like location, purpose, or related system IDs. You can retrieve this
688- metadata later by calling `get_detector()`.
689- :param priming_group_id: Optional ID of an existing PrimingGroup to associate with this detector.
690-
691- :return: The created Detector object
692- """
693- # Delegate to the parent class implementation
694- return super ().create_bounding_box_detector (
695- name = name ,
696- query = query ,
697- class_name = class_name ,
698- max_num_bboxes = max_num_bboxes ,
699- group_name = group_name ,
700- confidence_threshold = confidence_threshold ,
701- patience_time = patience_time ,
702- pipeline_config = pipeline_config ,
703- metadata = metadata ,
704- priming_group_id = priming_group_id ,
705- )
706-
707634 def create_text_recognition_detector ( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
708635 self ,
709636 name : str ,
0 commit comments