@@ -363,52 +363,46 @@ def create_detector( # noqa: PLR0913
363363 Create a new Detector with a given name and query.
364364
365365 Counting and Multiclass detectors are in Beta, and can be created through the
366- ExperimentalApi via the `create_counting_detector` and `create_multiclass_detector` methods.
366+ ExperimentalApi via the :meth:`ExperimentalApi.create_counting_detector` and
367+ :meth:`ExperimentalApi.create_multiclass_detector` methods.
367368
368369 **Example usage**::
369370
370371 gl = Groundlight()
371372
372- # Create a basic binary detector
373- detector = gl.create_detector(
374- name="dog-on-couch-detector",
375- query="Is there a dog on the couch?",
376- confidence_threshold=0.9,
377- patience_time=30.0
373+ # Create a basic binary detector detector = gl.create_detector(
374+ name="dog-on-couch-detector", query="Is there a dog on the couch?",
375+ confidence_threshold=0.9, patience_time=30.0
378376 )
379377
380- # Create a detector with metadata
381- detector = gl.create_detector(
382- name="door-monitor",
383- query="Is the door open?",
384- metadata={"location": "front-entrance", "building": "HQ"},
385- confidence_threshold=0.95
378+ # Create a detector with metadata detector = gl.create_detector(
379+ name="door-monitor", query="Is the door open?", metadata={"location":
380+ "front-entrance", "building": "HQ"}, confidence_threshold=0.95
386381 )
387382
388- # Create a detector in a specific group
389- detector = gl.create_detector(
390- name="vehicle-monitor",
391- query="Are there vehicles are in the parking lot?",
392- group_name="parking-monitoring",
393- patience_time=60.0
383+ # Create a detector in a specific group detector = gl.create_detector(
384+ name="vehicle-monitor", query="Are there vehicles are in the parking lot?",
385+ group_name="parking-monitoring", patience_time=60.0
394386 )
395- :param name: A short, descriptive name for the detector. This name should be unique within your account
396- and help identify the detector's purpose.
397- :param query: The question that the detector will answer about images. For binary classification,
398- this should be a yes/no question (e.g. "Is there a person in the image?").
399- :param group_name: Optional name of a group to organize related detectors together. If not specified,
400- the detector will be placed in the default group.
401- :param confidence_threshold: A value between 0.5 and 1 that sets the minimum confidence level required
402- for the ML model's predictions. If confidence is below this threshold,
403- the query may be sent for human review.
404- :param patience_time: The maximum time in seconds that Groundlight will attempt to generate a
405- confident prediction before falling back to human review. Defaults to 30 seconds.
406- :param pipeline_config: Advanced usage only. Configuration string needed to instantiate a specific
407- prediction pipeline for this detector.
408- :param metadata: A dictionary or JSON string containing custom key/value pairs to associate with
409- the detector (limited to 1KB). This metadata can be used to store additional
410- information like location, purpose, or related system IDs. You can retrieve this
411- metadata later by calling `get_detector()`.
387+ :param name: A short, descriptive name for the detector. This name should be unique within
388+ your account and help identify the detector's purpose.
389+ :param query: The question that the detector will answer about images. For binary
390+ classification, this should be a yes/no question (e.g. "Is there a person in
391+ the image?").
392+ :param group_name: Optional name of a group to organize related detectors together. If not
393+ specified, the detector will be placed in the default group.
394+ :param confidence_threshold: A value between 0.5 and 1 that sets the minimum confidence
395+ level required for the ML model's predictions. If confidence is
396+ below this threshold, the query may be sent for human review.
397+ :param patience_time: The maximum time in seconds that Groundlight will attempt to generate
398+ a confident prediction before falling back to human review. Defaults to
399+ 30 seconds.
400+ :param pipeline_config: Advanced usage only. Configuration string needed to instantiate a
401+ specific prediction pipeline for this detector.
402+ :param metadata: A dictionary or JSON string containing custom key/value pairs to associate
403+ with the detector (limited to 1KB). This metadata can be used to store
404+ additional information like location, purpose, or related system IDs. You
405+ can retrieve this metadata later by calling `get_detector()`.
412406
413407 :return: The created Detector object
414408 """
0 commit comments