@@ -370,39 +370,46 @@ def create_detector( # noqa: PLR0913
370370
371371 gl = Groundlight()
372372
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
373+ # Create a basic binary detector
374+ detector = gl.create_detector(
375+ name="dog-on-couch-detector",
376+ query="Is there a dog on the couch?",
377+ confidence_threshold=0.9,
378+ patience_time=30.0
376379 )
377380
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
381+ # Create a detector with metadata
382+ detector = gl.create_detector(
383+ name="door-monitor",
384+ query="Is the door open?",
385+ metadata={"location": "front-entrance", "building": "HQ"},
386+ confidence_threshold=0.95
381387 )
382388
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
389+ # Create a detector in a specific group
390+ detector = gl.create_detector(
391+ name="vehicle-monitor",
392+ query="Are there vehicles are in the parking lot?",
393+ group_name="parking-monitoring",
394+ patience_time=60.0
386395 )
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()`.
396+ :param name: A short, descriptive name for the detector. This name should be unique within your account
397+ and help identify the detector's purpose.
398+ :param query: The question that the detector will answer about images. For binary classification,
399+ this should be a yes/no question (e.g. "Is there a person in the image?").
400+ :param group_name: Optional name of a group to organize related detectors together. If not specified,
401+ the detector will be placed in the default group.
402+ :param confidence_threshold: A value between 0.5 and 1 that sets the minimum confidence level required
403+ for the ML model's predictions. If confidence is below this threshold,
404+ the query may be sent for human review.
405+ :param patience_time: The maximum time in seconds that Groundlight will attempt to generate a
406+ confident prediction before falling back to human review. Defaults to 30 seconds.
407+ :param pipeline_config: Advanced usage only. Configuration string needed to instantiate a specific
408+ prediction pipeline for this detector.
409+ :param metadata: A dictionary or JSON string containing custom key/value pairs to associate with
410+ the detector (limited to 1KB). This metadata can be used to store additional
411+ information like location, purpose, or related system IDs. You can retrieve this
412+ metadata later by calling `get_detector()`.
406413
407414 :return: The created Detector object
408415 """
0 commit comments