Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
45bbe9d
Initial commit
dmytroye Dec 8, 2025
56e31ed
Add debug logging
dmytroye Dec 8, 2025
77b39b6
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 9, 2025
71381ca
Phyton indent fix
dmytroye Dec 9, 2025
1211d39
Phyton indent fix
dmytroye Dec 9, 2025
070cfbd
Phyton indent fix
dmytroye Dec 9, 2025
36c81e4
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 9, 2025
57c1b6f
Fix SyntaxError
dmytroye Dec 9, 2025
3674cb9
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 10, 2025
22252fe
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 10, 2025
98bfa61
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 10, 2025
4f7333a
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 11, 2025
66570c7
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 11, 2025
1e97534
Apply suggestions from code review
dmytroye Dec 11, 2025
41eaab7
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 11, 2025
8b0abe1
Merge remote-tracking branch 'origin/main' into dmytroye/subscribe-an…
dmytroye Dec 15, 2025
6f570f9
Merge branch 'dmytroye/subscribe-analytics-to-mqtt' of https://github…
dmytroye Dec 15, 2025
6c93325
Add flag to disable tracker in controller
dmytroye Dec 15, 2025
93196d9
Add flag to demo example docker-compose
dmytroye Dec 15, 2025
45d6b91
Indent fix
dmytroye Dec 15, 2025
ef542a9
Apply suggestions from code review
dmytroye Dec 15, 2025
a82f36a
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 15, 2025
8e19ac7
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 16, 2025
e4d9375
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 17, 2025
c146c78
Dissable tracker flag
dmytroye Dec 17, 2025
38a9bbb
If tracker is enabled, use direct tracker call
dmytroye Dec 17, 2025
5922c7c
Phyton ident
dmytroye Dec 17, 2025
07157cd
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 17, 2025
05b101f
Fix errors on MQTT messeges
dmytroye Dec 17, 2025
45b6dc2
Remove logs and debug changes
dmytroye Dec 17, 2025
4359918
Whitespaces
dmytroye Dec 17, 2025
317fffe
Get frame rate from mqtt
dmytroye Dec 17, 2025
4d131d6
Don't subscribe to camera and sensor topics when --tracker-disabled
dmytroye Dec 18, 2025
b1086af
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 18, 2025
01e4e6e
Subscribe to scene/data only when tracke disabled
dmytroye Dec 18, 2025
6a8b258
Delete whitespace
dmytroye Dec 18, 2025
77b5b44
Disable publishing to data/scene when tracke is dissabled
dmytroye Dec 18, 2025
4c0e0fc
Add logging
dmytroye Dec 18, 2025
e6302e3
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 19, 2025
5b69ee2
WIP on mqtt messeges
dmytroye Dec 19, 2025
106a768
WIP debug
dmytroye Dec 19, 2025
3e13572
remove field
dmytroye Dec 19, 2025
5f10e07
WIP
dmytroye Dec 19, 2025
25fc819
Remove whitespace
dmytroye Dec 19, 2025
e72ca28
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 22, 2025
231fc75
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 22, 2025
c1e3788
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 29, 2025
4cba62e
Change order
dmytroye Dec 29, 2025
73bc1d9
WIP
dmytroye Dec 29, 2025
98ac73a
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Dec 30, 2025
2fd07c5
Fix analytics mode: preserve camera_bounds and ref_camera_frame_rate …
dmytroye Dec 30, 2025
2bab1a7
Remove _normalize_camera_bounds
dmytroye Dec 30, 2025
e650bd3
CleanUp
dmytroye Dec 31, 2025
6478510
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Jan 12, 2026
fdf10fd
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Jan 12, 2026
b94a6f7
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Jan 12, 2026
9263330
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Jan 15, 2026
d387d10
Merge branch 'main' into dmytroye/subscribe-analytics-to-mqtt
dmytroye Jan 15, 2026
054d6ed
Remove whitespace
dmytroye Jan 15, 2026
7477fce
Add analytics-only mode flag
dmytroye Jan 15, 2026
6518482
Update docker-compose-dl-streamer-example.yml
dmytroye Jan 15, 2026
0897c79
Revert changes to detections_builder.py
dmytroye Jan 15, 2026
fa01d3c
Merge branch 'ITEP-83027/controller-analytics-only-mode' of https://g…
dmytroye Jan 15, 2026
59dd355
Refactor scene.py changes
dmytroye Jan 15, 2026
9d982d2
Review scene_controller.py changes
dmytroye Jan 15, 2026
88c26c2
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 15, 2026
8a5a3bc
Apply suggestions from code review
dmytroye Jan 15, 2026
ba89bef
Update controller/src/controller/scene_controller.py
dmytroye Jan 15, 2026
7bac973
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 16, 2026
55910f1
Update controller/src/controller-cmd
dmytroye Jan 16, 2026
bcee34a
Using cached tracked objects to outer if condition
dmytroye Jan 16, 2026
51f77db
Remove redundant warnig
dmytroye Jan 16, 2026
4f611c7
Simplify subscribe if condition
dmytroye Jan 16, 2026
cbe2197
Remove unnecessary conditions
dmytroye Jan 16, 2026
9670a16
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 19, 2026
e9ed557
Add Analytics Only mode to k8 template
dmytroye Jan 19, 2026
ed18889
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 19, 2026
6ec740f
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 20, 2026
b883dc8
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 21, 2026
50d2633
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 21, 2026
6434539
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 21, 2026
4ec6213
Remove frame_rate
dmytroye Jan 22, 2026
37e5759
Use ENV variable CONTROLLER_ENABLE_ANALYTICS_ONLY to enable analytics…
dmytroye Jan 22, 2026
553bd8b
Put if self.analytics_only to the beginning of the function processCa…
dmytroye Jan 22, 2026
f9c081a
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 22, 2026
5b65e4d
Add check that each object is a dictionary
dmytroye Jan 22, 2026
996dfa9
Merge branch 'ITEP-83027/controller-analytics-only-mode' of https://g…
dmytroye Jan 22, 2026
3fec81f
Fix indentation
dmytroye Jan 22, 2026
ce7918b
Move deserialization check to _deserializeTrackedObjects()
dmytroye Jan 22, 2026
efa947c
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 22, 2026
86b233c
Update getTrackedObjects description
dmytroye Jan 22, 2026
0e038ce
Fix indentation
dmytroye Jan 22, 2026
17cd4ef
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
saratpoluri Jan 22, 2026
6297f87
Update make targets with CONTROLLER_ENABLE_ANALYTICS_ONLY env variable
dmytroye Jan 23, 2026
99e6f00
Change K8 chart to use CONTROLLER_ENABLE_ANALYTICS_ONLY
dmytroye Jan 23, 2026
50fe734
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 23, 2026
23b3d23
Update controller/src/controller/scene.py
dmytroye Jan 23, 2026
de73b1f
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
scenescapecicd Jan 23, 2026
c827c57
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 24, 2026
2fe7bfb
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 26, 2026
4478d34
Update docs
dmytroye Jan 26, 2026
6e2ad63
Add conditional subscription logic based on analytics_only for child …
dmytroye Jan 26, 2026
e3c8a03
Add CONTROLLER_ENABLE_ANALYTICS_ONLY to docker-compose-dls-perf.yml i…
dmytroye Jan 26, 2026
0d59c2c
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 26, 2026
b096324
Update subscription logic for ChildSceneController
dmytroye Jan 26, 2026
528679f
Retrack child scene only in default mode
dmytroye Jan 26, 2026
ae2c1d5
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 26, 2026
71e6e25
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 26, 2026
e933a83
Add controller/src/controller/controller_mode.py with singleton patte…
dmytroye Jan 26, 2026
ef47e77
Fix indent
dmytroye Jan 26, 2026
95082bd
Delete redundant ControllerMode import from chache_manager.py
dmytroye Jan 26, 2026
559a359
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
saratpoluri Jan 27, 2026
9eb771b
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
tdorauintc Jan 27, 2026
b739d17
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 27, 2026
4d40407
revert cache_manager.py
dmytroye Jan 27, 2026
b1a250f
Remove empty lines
dmytroye Jan 27, 2026
5cbbbf1
Apply suggestions from code review
dmytroye Jan 27, 2026
dbbe0ab
Merge branch 'ITEP-83027/controller-analytics-only-mode' of https://g…
dmytroye Jan 27, 2026
ea53d79
Update controller/docs/user-guide/get-started.md
dmytroye Jan 27, 2026
ec91b6f
Update controller/docs/user-guide/get-started.md
dmytroye Jan 27, 2026
bc94202
Remove if statement
dmytroye Jan 27, 2026
9d50953
Prettier
dmytroye Jan 27, 2026
a1e006f
Fix indent
dmytroye Jan 27, 2026
724eaaf
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
tdorauintc Jan 27, 2026
8e4068a
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
tdorauintc Jan 27, 2026
39cbc7f
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
tdorauintc Jan 28, 2026
d37ac4b
Extend if statement to not load tracker config in analytics only mode
dmytroye Jan 28, 2026
af59357
Fix Get Started guide
dmytroye Jan 28, 2026
82228da
Fix Get Started guide
dmytroye Jan 28, 2026
3705ddc
Static namespace mode for Controller's mode
dmytroye Jan 28, 2026
30d5bed
Dummy license fix
dmytroye Jan 28, 2026
66c6ebe
Fix show trails and events processing
dmytroye Jan 28, 2026
dc5eae0
Create trail group if it doesn't exist
dmytroye Jan 28, 2026
af6c199
Updated method names from snake_case to camelCase
dmytroye Jan 28, 2026
e4febe0
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 29, 2026
3c594ed
Add if statement for preserving camera_bounds from deserialized objec…
dmytroye Jan 29, 2026
fd3f56f
Fix return indentation
dmytroye Jan 29, 2026
916e450
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Jan 29, 2026
d51063c
Remove emty lines
dmytroye Jan 30, 2026
d7dfdfa
Remove emty lines
dmytroye Jan 30, 2026
a7e6f04
Adressing hiracracy topics subscriptions
dmytroye Jan 30, 2026
915997a
Consolidated the analytics-only mode check
dmytroye Jan 30, 2026
fe0b9ec
Subscribe to DATA_SENSOR in both modes
dmytroye Jan 30, 2026
f30b417
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 2, 2026
e217b98
Subscribe for events topic for child scene in both modes
dmytroye Feb 3, 2026
d1b8831
Subscribe for events topic for child scene in both modes
dmytroye Feb 3, 2026
f0a3e09
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 3, 2026
2c20ab2
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 3, 2026
18e39ce
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 3, 2026
44c67a2
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 4, 2026
1ca926c
Revert child_scene_controller changes
dmytroye Feb 4, 2026
6ef1e27
Revert child_scene_controller changes
dmytroye Feb 4, 2026
87f68c4
Revert child_scene_controller changes
dmytroye Feb 4, 2026
19acafd
Remove child scenes processing
dmytroye Feb 4, 2026
a67b75c
Remove redundant preserve camera bounds in Analytics only mode
dmytroye Feb 4, 2026
fb7f990
Update docs
dmytroye Feb 4, 2026
ddc6f00
Remove ControllerMode from detections_builder.py
dmytroye Feb 4, 2026
f34f563
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
dmytroye Feb 4, 2026
343a104
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
scenescapecicd Feb 5, 2026
969d3fb
Merge branch 'main' into ITEP-83027/controller-analytics-only-mode
scenescapecicd Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ CONTROLLER_METRICS_EXPORT_INTERVAL_S ?= 60
CONTROLLER_ENABLE_TRACING ?= false
CONTROLLER_TRACING_ENDPOINT ?= otel-collector.scenescape.intel.com:4317
CONTROLLER_TRACING_SAMPLE_RATIO ?= 1.0
CONTROLLER_ENABLE_ANALYTICS_ONLY ?= false

# ========================= Default Target ===========================

Expand Down Expand Up @@ -568,6 +569,7 @@ $(DLSTREAMER_SAMPLE_VIDEOS): ./dlstreamer-pipeline-server/convert_video_to_ts.sh
@echo "CONTROLLER_ENABLE_TRACING=$(CONTROLLER_ENABLE_TRACING)" >> $@
@echo "CONTROLLER_TRACING_ENDPOINT=$(CONTROLLER_TRACING_ENDPOINT)" >> $@
@echo "CONTROLLER_TRACING_SAMPLE_RATIO=$(CONTROLLER_TRACING_SAMPLE_RATIO)" >> $@
@echo "CONTROLLER_ENABLE_ANALYTICS_ONLY=$(CONTROLLER_ENABLE_ANALYTICS_ONLY)" >> $@
# ======================= Secrets Management =========================

.PHONY: init-secrets
Expand Down
2 changes: 2 additions & 0 deletions controller/docs/user-guide/How-to-configure-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This document guides users and developers on configuring the tracker for specific use cases during Intel® SceneScape deployment.

**Note:** Tracker configuration is not needed when running the Scene Controller in analytics-only mode (`--analytics-only` flag or `CONTROLLER_ENABLE_ANALYTICS_ONLY=true`), as tracking is performed by a separate Tracker service.

## Tracker Configuration with Time-Based Parameters

### Enabling Time-Based Parameters
Expand Down
55 changes: 53 additions & 2 deletions controller/docs/user-guide/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- The hardware platform must be at least a 10th Generation Intel® Core™ i5 Processor or Intel® Xeon® Scalable processor, with at least 8+GB of RAM and 64+GB of storage.
- [How to build Scene Controller from source](How-to-build-source.md)

## Running the service using Docker Compose
## Running the service using Docker

- **Navigate to the Directory**:

Expand All @@ -16,7 +16,7 @@
- **Generate secrets**:

```bash
make build-secrets
make init-secrets
```

- **Start the service**:
Expand Down Expand Up @@ -63,3 +63,54 @@
- **Access scene controller output through MQTT**:
- Refer to [scene-controller-api.yaml](api-docs/scene-controller-api.yaml) on how to access scene controller output
- Refer to [scene controller sequence diagram](overview.md#sequence-diagram-scene-controller-workflow)

## Running in Analytics-Only Mode

Analytics-only mode allows the Scene Controller to consume tracked objects from a separate Tracker service via MQTT instead of performing tracking internally. This is useful for distributed deployments where tracking and analytics are handled by separate services.

- **Enable analytics-only mode**:

Add the `--analytics-only` flag to the docker run command:

```bash
docker run --rm \
--init \
--network scenescape \
-v scenescape_vol-media:/home/scenescape/SceneScape/media \
-v $(pwd)/controller/config/tracker-config.json:/home/scenescape/SceneScape/tracker-config.json \
-v $(pwd)/manager/secrets/certs/scenescape-ca.pem:/run/secrets/certs/scenescape-ca.pem:ro \
-v $(pwd)/manager/secrets/django:/run/secrets/django:ro \
-v $(pwd)/manager/secrets/controller.auth:/run/secrets/controller.auth:ro \
--name scene \
scenescape-controller \
controller \
--broker broker.scenescape.intel.com \
--ntp ntpserv \
--analytics-only
```

Alternatively, use the environment variable:

```bash
docker run --rm \
--init \
--network scenescape \
-e CONTROLLER_ENABLE_ANALYTICS_ONLY=true \
-v scenescape_vol-media:/home/scenescape/SceneScape/media \
-v $(pwd)/controller/config/tracker-config.json:/home/scenescape/SceneScape/tracker-config.json \
-v $(pwd)/manager/secrets/certs/scenescape-ca.pem:/run/secrets/certs/scenescape-ca.pem:ro \
-v $(pwd)/manager/secrets/django:/run/secrets/django:ro \
-v $(pwd)/manager/secrets/controller.auth:/run/secrets/controller.auth:ro \
--name scene \
scenescape-controller \
controller \
--broker broker.scenescape.intel.com \
--ntp ntpserv
```

- **Note**: In analytics-only mode (experimental feature):
- The tracker is not initialized
- Camera and scene detection data processing is skipped
- The controller subscribes to tracked object data from MQTT topics published by the Tracker service
- Analytics processing (regions, tripwires, sensors) continues to function normally
- Child scenes are not supported in analytics-only mode
2 changes: 2 additions & 0 deletions controller/docs/user-guide/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ To deploy the scene controller service, refer to the [Get started](get-started.m

`--visibility_topic`: Specifies the topic for publishing visibility information, which includes the visibility of objects in cameras. Options are `unregulated`, `regulated`, or `none`.

`--analytics-only`: Enables analytics-only mode (experimental feature). In this mode, the Scene Controller consumes tracked objects from a separate Tracker service via MQTT instead of performing tracking internally. The tracker is not initialized, and camera/scene data processing is skipped. Child scenes are not supported. This mode can also be enabled via the `CONTROLLER_ENABLE_ANALYTICS_ONLY` environment variable set to `true`.

### Tracker Configuration

For details on how to configure the tracker, see [How to configure tracker](./How-to-configure-tracker.md).
Expand Down
9 changes: 8 additions & 1 deletion controller/src/controller-cmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: (C) 2024 - 2025 Intel Corporation
# SPDX-FileCopyrightText: (C) 2024 - 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import argparse
import os

from controller.scene_controller import SceneController
from controller.controller_mode import ControllerMode
from controller.observability import metrics, tracing

def build_argparser():
Expand Down Expand Up @@ -43,10 +44,16 @@ def build_argparser():
parser.add_argument("--visibility_topic", help="Which topic to publish visibility on."
"Valid options are 'unregulated', 'regulated', or 'none'",
default="regulated")
parser.add_argument("--analytics-only", action="store_true",
default=os.getenv("CONTROLLER_ENABLE_ANALYTICS_ONLY") == "true",
help="Enable analytics-only mode. Use this when running a separate Tracker service that publishes tracking data to MQTT.")
return parser

def main():
args = build_argparser().parse_args()

ControllerMode.initialize(analytics_only=args.analytics_only)

metrics.init()
tracing.init()
controller = SceneController(args.rewriteBadTime, args.rewriteAllTime,
Expand Down
74 changes: 74 additions & 0 deletions controller/src/controller/controller_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-FileCopyrightText: (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from scene_common import log

class ControllerMode:
"""
Static namespace for managing controller's mode.

Usage:
# Initialize once at startup
ControllerMode.initialize(analytics_only=True)

# Access anywhere in the codebase
if ControllerMode.isAnalyticsOnly():
# analytics-only mode
else:
# default mode
"""

_initialized = False
_analytics_only = False

@classmethod
def initialize(cls, analytics_only=False):
"""
Initialize the controller mode. Should be called once at startup.

Args:
analytics_only: If True, controller runs in analytics-only mode
(no tracking, consumes already-tracked objects)
"""
if cls._initialized:
log.warning("ControllerMode already initialized. Ignoring re-initialization.")
return

cls._analytics_only = analytics_only
cls._initialized = True

if analytics_only:
log.info("Controller mode: ANALYTICS-ONLY (tracker disabled)")
else:
log.info("Controller mode: DEFAULT (tracker enabled)")

@classmethod
def isAnalyticsOnly(cls):
"""
Check if controller is running in analytics-only mode.

Returns:
bool: True if analytics-only mode is enabled, False otherwise
"""
if not cls._initialized:
log.warning("ControllerMode not initialized. Defaulting to default mode.")
return False
return cls._analytics_only

@classmethod
def isInitialized(cls):
"""
Check if the controller mode has been initialized.

Returns:
bool: True if initialized, False otherwise
"""
return cls._initialized

@classmethod
def reset(cls):
"""
Reset the singleton state.
"""
cls._initialized = False
cls._analytics_only = False
4 changes: 2 additions & 2 deletions controller/src/controller/detections_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: (C) 2024 - 2025 Intel Corporation
# SPDX-FileCopyrightText: (C) 2024 - 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import numpy as np
Expand Down Expand Up @@ -91,7 +91,7 @@ def computeCameraBounds(scene, aobj, obj_dict):
camera_bounds = {}
for cameraID in obj_dict['visibility']:
bounds = None
if aobj and hasattr(aobj.vectors[0].camera, 'cameraID') \
if aobj and len(aobj.vectors) > 0 and hasattr(aobj.vectors[0].camera, 'cameraID') \
and cameraID == aobj.vectors[0].camera.cameraID:
bounds = getattr(aobj, 'boundingBoxPixels', None)
elif scene:
Expand Down
Loading
Loading