Configure detections and rules
Use an administrator user session or a permitted customer user session with delegated analytics access to the selected camera. Choose an independent demonstration camera for your first configuration.
- Read available detection models and check support for the detection you plan to use.
- Retrieve the camera’s current analytics. Keep its current
revisionandscene. - Add or edit a region or line inside that scene. Use coordinates normalized to the image. Region detection configurations have stable IDs, labels, and selectors. Rules refer to those configuration IDs.
- Submit Replace stream analytics with
{"scene": ...}and the current stream revision inIf-Match. - Read analytics again and confirm the saved revision and IDs. Observe the camera and review incidents generated by the rule.
Prepare the scene
Section titled “Prepare the scene”Start from the current scene when editing a configured camera. Regions contain polygon, detectionConfigurations, and rules. Lines use their own geometry and rule models. The StreamSceneModel links the complete supported variants.
A detection selector chooses objects, face matches, reference-image matches, or semantic matches. A rule supplies conditions such as presence or absence, timing, schedule, severity, and actions. PPE analysis and PPE rule predicates use their dedicated model fields.
Keep rule actions empty while validating a demonstration rule. Add approved notification or recording actions once the detection behaves as intended.
Submit the change
Section titled “Submit the change”For a new demonstration camera, this complete example detects a person inside a region and applies a two-second presence rule. Save it as analytics.json. When editing an existing scene, merge your intended changes into the scene you retrieved.
{ "scene": { "regions": [ { "id": "loading-bay", "label": "Loading bay", "polygon": [ { "x": 0.05, "y": 0.05 }, { "x": 0.95, "y": 0.05 }, { "x": 0.95, "y": 0.95 }, { "x": 0.05, "y": 0.95 } ], "detectionConfigurations": [ { "id": "person", "label": "Person", "selector": { "classNames": [ "person" ], "minimumConfidence": 0.5 } } ], "rules": [ { "id": "person-present", "label": "Person present", "type": "presence", "configurationId": "person", "dwellSeconds": 2, "resetSeconds": 10, "actions": [] } ] } ], "lines": [] }}Save the complete replacement body as analytics.json, and set EOI_REVISION to the revision you just read.
curl --fail-with-body --silent --show-error \ --request PUT \ --cookie "${EOI_COOKIE_JAR}" \ --header "X-EyesOnIt-Session-Id: ${EOI_SESSION_ID}" \ --header "X-CSRF-Token: ${EOI_CSRF_TOKEN}" \ --header "If-Match: ${EOI_REVISION}" \ --header "Content-Type: application/json" \ --data-binary @analytics.json \ "${EOI_API_BASE_URL}/streams/${EOI_STREAM_ID}/analytics"If the server returns 409, retrieve the latest scene and reconcile the changes before resubmitting.
