# ObjectDetectorOptions

    class ObjectDetectorOptions: TaskOptions, NSCopying

Options for setting up a `ObjectDetector`.
- `
  ### [categoryAllowlist](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)categoryAllowlist)

  ` The allowlist of category names. If non-empty, detection results whose category name is not in this set will be filtered out. Duplicate or unknown category names are ignored. Mutually exclusive with categoryDenylist.

  #### Declaration

  Swift

      var categoryAllowlist: [String] { get set }

- `
  ### [categoryDenylist](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)categoryDenylist)

  ` The denylist of category names. If non-empty, detection results whose category name is in this set will be filtered out. Duplicate or unknown category names are ignored. Mutually exclusive with categoryAllowlist.

  #### Declaration

  Swift

      var categoryDenylist: [String] { get set }

- `
  ### [displayNamesLocale](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)displayNamesLocale)

  ` The locale to use for display names specified through the TFLite Model Metadata, if any. Defaults to English.

  #### Declaration

  Swift

      var displayNamesLocale: String { get set }

- `
  ### [maxResults](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)maxResults)

  ` The maximum number of top-scored classification results to return. If \< 0, all available results will be returned. If 0, an invalid argument error is returned.

  #### Declaration

  Swift

      var maxResults: Int { get set }

- `
  ### [objectDetectorLiveStreamDelegate](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)objectDetectorLiveStreamDelegate)

  ` An object that confirms to `ObjectDetectorLiveStreamDelegate` protocol. This object must implement `objectDetector(_:didFinishDetectionWithResult:timestampInMilliseconds:error:)` to receive the results of performing asynchronous object detection on images (i.e, when `runningMode` = `.liveStream`).

  #### Declaration

  Swift

      weak var objectDetectorLiveStreamDelegate: (any ObjectDetectorLiveStreamDelegate)? { get set }

- `
  ### [runningMode](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)runningMode)

  ` Running mode of the object detector task. Defaults to `.image`. `ObjectDetector` can be created with one of the following running modes: 1. `.image`: The mode for performing object detection on single image inputs. 2. `.video`: The mode for performing object detection on the decoded frames of a video. 3. `.liveStream`: The mode for performing object detection on a live stream of input data, such as from the camera.

  #### Declaration

  Swift

      var runningMode: RunningMode { get set }

- `
  ### [scoreThreshold](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ObjectDetectorOptions.md.txt#/c:objc(cs)MPPObjectDetectorOptions(py)scoreThreshold)

  ` Score threshold to override the one provided in the model metadata (if any). Results below this value are rejected.

  #### Declaration

  Swift

      var scoreThreshold: Float { get set }