AI Model by Roboflow

Run a Roboflow AI Model inference on input frames, and add detected objects or object classes to metadata.

Overview

The AI Model by Roboflow node allows for running a Roboflow AI Model inference on input frames, and adds detected objects to metadata. This functionality is useful for applications requiring object detection and recognition.

Inputs & Outputs

  • Inputs : 1, Media Format : Raw Video
  • Outputs : 1, Media Format: Raw Video
  • Output Metadata : Objects metadata

Properties

PropertyDescriptionTypeDefaultRequired
model_idModel alias or ID from Roboflow. Typical format is {project_id}/{version}.stringnullYes
model_typeModel type. Options: Detector (detector); Classifier (classifier).enumdetectorYes
roboflow_api_keyRoboflow Private API Key (for inference) can be found at Account -> Settings -> Workspace -> Roboflow API in your Roboflow account.stringnullYes
inference_modeInference mode. Options: Full frame (full_frame): Run inference on entire frame; Specific objects (objects): Run inference on specific object types, ex for classification.enumfull_frameYes
objects_to_inferex. car,person,car.red. Object types and classes to include. Leave blank to include all. Conditional on inference_mode being objects.model-labelsnullNo
intervalInfer on every nth frame. 1 means infer every frame. Range: minimum 1. Unit: frames.number1Yes
confidence_thresholdEnable to override the default minimum inference threshold for all classes. Range: minimum 0, maximum 1.0. Step: 0.1.float0.5No
iou_thresholdIncrease the threshold to reduce potential duplicate detections of a single object. Conditional on model_type being detector. Range: minimum 0, maximum 1.0. Step: 0.1.float0.5No
min_object_sizeMinimum output object size. Conditional on model_type being detector.stringnullNo
reclassify_size_thresholdReclassify a specific object if size changes by this percent. Only used when inference mode objects, and Track objects node is present before this node. Conditional on model_type being classifier. Range: minimum 1. Unit: percent.number50No
max_classify_attemptsAttempt classification per object this many times before giving up if it yields no class results. Only used when inference mode objects, and Track objects node is present before this node. Conditional on model_type being classifier. Range: minimum 1.number3No

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
objectsarrayValue of objects.
objects[].attributesdictionaryObject's classes, as identified by Classifier models chained to this Object Detection model. Contains: label : Class label, probability : Probability, class_id : Unique id for the class' label
objects[].attributes[].class_idintUnique id for this object's label.
objects[].attributes[].labelstringLabel for this object as outlined in Model Labels
objects[].attributes[].probabilityfloatProbability of detection
objects[].class_idintUnique id for this object's label.
objects[].idlong int, *optional*If present, it is a unique ID assigned to this object by a Track Objects Node
objects[].labelstringLabel for this object as outlined in Model Labels
objects[].probabilityfloatProbability of detection
objects[].rect.heightintegerValue of height.
objects[].rect.leftintegerValue of left.
objects[].rect.topintegerValue of top.
objects[].rect.widthintegerValue of width.

JSON example

{
  "objects": [
    {
      "attributes": [
        {
          "class_id": 10,
          "label": "white",
          "probability": 0.9437
        }
      ],
      "class_id": 0,
      "id": 5750484150146564100,
      "label": "car",
      "probability": 0.7,
      "rect": {
        "height": 25,
        "left": 656,
        "top": 201,
        "width": 47
      }
    }
  ]
}

Object labels and attributes

  • Object labels/classes added: Detection models add their prediction labels and class IDs. Full-frame classification can add a full_frame object with class 44444.
  • Object attribute labels/classes added: Classification labels use the model's class IDs; multi-label classification uses class 44445.

Did this page help you?