Detection utilities
Pure helpers to slice, filter, sort and read detection results.
Detection By Index
Reads a DetectionResult by index.
In: Detections:DetectionResult, Index:Int
Out: Found, Detection, ClassId, Pos, Size, Confidence
After Computer Vision / AI nodes that return several results.
Template Multi.Result → Detection By Index(Index=2).
Filter By Class
Filters detections by class id.
In: Detections, ClassId:Int
Out: Results, Found, Count
Apply after model detection.
Objects → Filter By Class(enemy).
Largest Detection
Picks the detection with the largest area.
In: Detections
Out: Found, Detection, Pos, Size, Area, Confidence
When the biggest object matters more than the closest.
Pick the largest visible target.
Detection Size
Returns the size of the first detection.
In: Detection:DetectionResult
Out: Size:Vec2, Width:Float, Height:Float
Check the size of the detected object.
Detection Size.Width > 50 → If.
Sort Detections
Sorts detections by confidence, distance, area, x or y.
In: Detections, Mode:String, Reference:Vec2, Descending:Bool
Out: Results, Count
Mode sets the sort criterion.
Sort by distance → Detection By Index(0).
Detection Exists
Checks whether any detections exist.
In: Detections
Out: Exists:Bool, Count:Int
A handy check after filters.
Filter By Class.Results → Detection Exists → If.
Object Count
Compare the number of found objects with a value.
In: Detections, Operator:String, Value:Int
Out: Result:Bool, Count:Int
Object Count(>, 3) → If → prioritize AOE.