Object Detection

Object Detection operator properties for Script Engine. Runs an AI model on each frame to find objects and report their position with a bounding box, label, and confidence score. Useful for automated alerts when specific things appear (people, vehicles, packages), counting objects in view, security and surveillance triggers, sports analytics, and feeding object positions to other components for auto-framing or selective effects. Detection accuracy depends entirely on the loaded model and how closely the incoming video matches what it was trained on.

Property Type Access Description
ShowAdvancedOptions bool get/set Whether to reveal advanced configuration in the editor. [default=false]. Toggle on to show options like the execution provider, detection area, classes and data collection.
ModelSourceUrl Uri get/set Path to the AI model file (.onnx or encrypted .connx) used for object detection. Pick a detection-type model trained on the objects you care about. Loading a new model reinitialises the operator and refreshes the available class list. Composer-encrypted (.connx) commercial models may be license-limited.
ModelSize string get Size of the loaded model file, formatted as a string (read-only).
TotalClasses int get Number of distinct object classes the loaded model can detect (read-only). Reflects what the model was trained on — for example, a generic everyday-objects model reports around 80 classes, while a specialised model may report only a handful.
ModelInternalLicense string get License declared by the model itself (read-only).
ComposerModelLicense string get Composer-side license status for commercial Composer-issued models (read-only). Reads "Licensed" if your Composer license covers this model, "Unlicensed" if it doesn't — unlicensed Composer models stop running after a short trial window.
ExecutionProvider ExecutionProvider get/set Which runtime the model runs on — CUDA (default) or TensorRT. CUDA works out of the box on any compatible GPU. TensorRT is faster once the engine cache is built but takes time to generate that cache the first time. Pick TensorRT for long-running production setups; stick with CUDA for quick experimentation.
PrecisionMode TensorRtPrecisionMode get/set Numeric precision used by the TensorRT engine — FP32 (default) or FP16. FP32 gives the most accurate results; FP16 is faster and uses less memory at a small accuracy cost. Only relevant when ExecutionProvider is TensorRT.
EngineCacheDir string get/set Folder where the TensorRT engine cache is stored. Must be a folder with read and write permission. Building the engine cache the first time takes minutes; subsequent runs reuse the cached file. Only relevant when ExecutionProvider is TensorRT.
ModelResizeMode ModelResizeMode get/set How the frame is fitted to the model's input size — Proportional or Stretched. Proportional preserves the aspect ratio (recommended in most cases). Stretched distorts the image to fill the model's input — only useful for models trained on a stretched dataset.
DisplayScanArea bool get/set Whether to draw the detection area outline on screen. [default=false]. Useful while configuring the area; turn off in production output.
CropAreaLeft int get/set Detection-area inset from the left edge, in pixels. [min=0, max=4096, default=0]. Together with the other Crop sliders, defines a sub-region of the frame to scan. Use to cut out areas that produce false positives (signage, screens in the background) or to focus on the area that actually matters.
CropAreaRight int get/set Detection-area inset from the right edge, in pixels. [min=0, max=4096, default=0].
CropAreaTop int get/set Detection-area inset from the top edge, in pixels. [min=0, max=4096, default=0].
CropAreaBottom int get/set Detection-area inset from the bottom edge, in pixels. [min=0, max=4096, default=0].
ResetCropAreaCommand Command get Reset all detection-area insets so the full frame is scanned.
AutoStartDetection bool get/set Whether to begin detection automatically once the model finishes loading. [default=true]. Saves a manual click when the project is loaded fresh; turn off if you want to start detection only on demand.
DetectionState DetectionState get Current state of the operator (read-only). Reports whether the model is loading, ready, running, stopped, or in an error state.
StartCommand Command get Begin detecting objects in incoming frames. Available once a valid detection model is loaded.
StopCommand Command get Stop detecting objects in incoming frames.
AvailableClasses StringCollectionEnum get/set Read-only list of every class the loaded model can detect. Useful for picking which class IDs or names to put in the filter fields.
FilteredClassesById string? get/set Comma-separated list of class IDs to keep — everything else is ignored. Use this to focus only on the objects you care about, for example "0,2" to keep only people and cars from a generic model. Leave empty to report all detected classes.
FilteredClassesByName string get/set Comma-separated list of class names to keep — everything else is ignored. Easier to read than IDs when you know the labels (for example "person,car"). Wildcards * match anywhere in the name (*phone*, tv*). Leave empty to report all detected classes.
ResetClassFilterCommand Command get Clear both class filters so every detected class is reported again.
Confidence int get/set Minimum confidence (in percent) a detection must score to be reported. [min=10, max=100, default=25]. Raise to suppress weak detections — only highly confident bounding boxes get through. Lower to surface marginal detections, at the cost of more false positives.
NonMaximumSupression int get/set How aggressively overlapping bounding boxes are merged into one. [min=0, max=100, default=70]. Lower values merge overlapping boxes more aggressively, reducing duplicates around the same object. Higher values keep more boxes — useful when objects of interest genuinely overlap (a row of cars, a crowd).
DetectionIntervalFrames int get/set Run detection only every Nth frame. [min=0, max=1000, default=0 (every frame)]. Set to 0 for the most responsive results — every frame is detected. Higher values reduce overall load by only running the model occasionally and reusing the previous boxes in between, useful when scenes change slowly and you want to keep capacity free for other operators.
MaxDetectionAgeFrames int get/set How many frames the last good detection stays valid if a later frame fails to detect. [min=0, max=60, default=3]. Higher values smooth over occasional misses by holding the last bounding boxes in place; lower values react faster to genuine changes but show empty results during brief glitches.
ResetThresholdCommand Command get Reset all settings to their defaults (confidence, NMS, detection interval, max detection age).
ScriptCallbackFunction string get/set Name of a Script Engine function to call each time detection produces a new result. Receives the JSON payload from DetectedClassesJson. Leave empty to disable. Useful for triggering scene switches, alerts, or downstream effects when something appears.
DisplayLabels bool get/set Whether to draw class names on each detected object. [default=true]. Turn off for a cleaner output where you only want to see the bounding boxes, or use the JSON output downstream without on-screen labels.
DisplayConfidence bool get/set Whether to draw the confidence score (in percent) on each detected object. [default=true].
DisplayBoundingBox bool get/set Whether to draw a rectangle around each detected object. [default=true]. Turn off if you want to use the JSON output downstream without any on-screen overlay.
BorderThickness int get/set Thickness of the bounding box outline, in pixels. [min=1, max=8, default=2].
FontSize int get/set Size of the label and confidence text drawn on each detection, in pixels. [min=6, max=30, default=11].
MaxConfidenceDecimals int get/set Number of decimal places shown for the confidence percentage. [min=0, max=4, default=2].
ResetVisualizationCommand Command get Reset all visualization settings to their defaults (labels, confidence, bounding boxes, thickness, font, decimals).
TotalDetections int get Number of objects detected in the most recent processed frame (read-only).
HighestConfidence string get Label and confidence of the strongest detection in the most recent frame (read-only). Formatted as "Name [class: id, confidence: 95.32%]". Empty when nothing is detected.
DetectedClasses string get Comma-separated list of class IDs detected in the most recent frame (read-only). Just the unique IDs — convenient for quick scripting checks like "is class 0 in this list".
DetectedClassesJson string get All detections in the most recent frame as a JSON array (read-only). Each element contains id, name, confidence, bounding box (x, y, width, height), frame number and timestamp. Convenient payload for scripts and external systems — feed this directly into a callback function and parse fields on the receiving side.
ProcessedFramesCounter int get Total number of frames the operator has processed since it started (read-only).
BackgroundComputeTime string get Time the AI model took to process the last frame, formatted as a millisecond string (read-only, debug).
ResultPaintTime string get Time taken to draw the bounding boxes onto the last frame, formatted as a millisecond string (read-only, debug).
DataCollectionActive bool get/set Whether the data collection workflow is active. [default=false]. When on, the operator can save frames where detection falls below the confidence threshold — useful for collecting more training data on the cases the current model gets wrong.
SelectFolderCommand Command get/set Open a folder picker to choose where collected frames are written.
SaveFrameLocation string get Folder where collected frames will be saved (read-only). Set via the folder-picker command.
CropDetectionArea bool get/set Whether collected frames are cropped to just the detection area before saving. [default=true]. On to save smaller, focused images that match what the model actually sees. Off to save the full frame for context.
ManualSaveStatus string get Status message from the last manual save attempt (read-only).
ManualSavedFramesCounter int get Total number of frames saved by the manual Save command this session (read-only).
SaveFrameCommand Command get Save the current frame as a JPEG to the configured folder, if any object detection falls below the confidence threshold.
AutoSaveFrameLimit int get/set Maximum number of frames the auto-collect run will save before stopping. [min=1, max=10000, default=1]. Acts as a safety stop so a long unattended run can't fill the disk.
AutoSavedFramesCounter int get Total number of frames the auto-collect run has saved so far (read-only).
AutoSaveMinimumClassCount int get/set Minimum number of detections in a frame before auto-collect will save it. [min=0, max=1000, default=0]. Useful to avoid saving frames that don't contain any objects of interest.
AutoSaveMinimumSecondsBetweenSave int get/set Minimum delay between consecutive auto-saves, in seconds. [min=0, max=600, default=0]. Stops the operator from saving near-identical frames in rapid succession.
AutoSaveClassesFound int get Number of distinct object classes detected in the last saved frame (read-only).
SaveFrameCounter int get Cumulative auto-save counter across the run (read-only).
AutoSaveLastSaveDateTime DateTime get Timestamp of the most recent auto-save (read-only).
StartAutoCollectFramesCommand Command get Begin the auto-collect run with the configured frame limit, minimum class count, and save interval.
StopAutoCollectFramesCommand Command get Stop the auto-collect run early.
ResetAutoCollectFramesCommand Command get Clear the auto-collect counters and timestamps to start a fresh run.

Inherits from: AbstractOperator, AbstractAudioMetering.

See also: Object Detection in Operators — user-facing introduction, screenshots, and section summaries.