toposync-ext-cameras 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. toposync_ext_cameras-0.1.1/.gitignore +39 -0
  2. toposync_ext_cameras-0.1.1/LICENSE +21 -0
  3. toposync_ext_cameras-0.1.1/PKG-INFO +72 -0
  4. toposync_ext_cameras-0.1.1/README.md +59 -0
  5. toposync_ext_cameras-0.1.1/pyproject.toml +19 -0
  6. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/__init__.py +1 -0
  7. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/extension.json +12 -0
  8. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/onvif/__init__.py +28 -0
  9. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/onvif/client.py +845 -0
  10. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/onvif/discovery.py +181 -0
  11. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/pipelines/__init__.py +61 -0
  12. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/pipelines/operators.py +2990 -0
  13. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/pipelines/postprocess.py +5095 -0
  14. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/plugin.py +1733 -0
  15. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/__init__.py +2 -0
  16. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/camera_hub.py +174 -0
  17. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/frame_grabber.py +851 -0
  18. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/mapping.py +543 -0
  19. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/motion.py +179 -0
  20. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/motion_bgsub.py +457 -0
  21. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/motion_sample_bg.py +532 -0
  22. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/processing/yolo.py +475 -0
  23. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/settings.py +250 -0
  24. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/326.js +2 -0
  25. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/326.js.LICENSE.txt +9 -0
  26. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/4.js +2 -0
  27. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/4.js.LICENSE.txt +19 -0
  28. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/623.js +2 -0
  29. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/623.js.LICENSE.txt +19 -0
  30. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/703.js +2 -0
  31. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/703.js.LICENSE.txt +9 -0
  32. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/753.js +2 -0
  33. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/753.js.LICENSE.txt +5 -0
  34. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/main.js +2 -0
  35. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/main.js.LICENSE.txt +9 -0
  36. toposync_ext_cameras-0.1.1/src/toposync_ext_cameras/static/remoteEntry.js +1 -0
  37. toposync_ext_cameras-0.1.1/ui/package.json +22 -0
  38. toposync_ext_cameras-0.1.1/ui/src/activate.tsx +13 -0
  39. toposync_ext_cameras-0.1.1/ui/src/api/camerasApi.ts +255 -0
  40. toposync_ext_cameras-0.1.1/ui/src/assets.d.ts +5 -0
  41. toposync_ext_cameras-0.1.1/ui/src/constants.ts +15 -0
  42. toposync_ext_cameras-0.1.1/ui/src/elements/CameraElementType.tsx +1859 -0
  43. toposync_ext_cameras-0.1.1/ui/src/entry.ts +3 -0
  44. toposync_ext_cameras-0.1.1/ui/src/parsing.ts +304 -0
  45. toposync_ext_cameras-0.1.1/ui/src/settings/CamerasSettingsPanel.tsx +874 -0
  46. toposync_ext_cameras-0.1.1/ui/src/tools/addCameraTool.ts +24 -0
  47. toposync_ext_cameras-0.1.1/ui/src/translations.ts +248 -0
  48. toposync_ext_cameras-0.1.1/ui/src/types.ts +181 -0
  49. toposync_ext_cameras-0.1.1/ui/src/ui/SubModal.tsx +50 -0
  50. toposync_ext_cameras-0.1.1/ui/src/wizard/CameraPipelineWizardModal.tsx +443 -0
  51. toposync_ext_cameras-0.1.1/ui/src/yolo.ts +111 -0
  52. toposync_ext_cameras-0.1.1/ui/tsconfig.json +13 -0
  53. toposync_ext_cameras-0.1.1/ui/webpack.config.js +46 -0
@@ -0,0 +1,39 @@
1
+ .DS_Store
2
+ .env
3
+ .venv
4
+ __pycache__/
5
+ *.pyc
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+
9
+ node_modules/
10
+ yarn.lock
11
+ .pnp.cjs
12
+ .pnp.loader.mjs
13
+ .yarn/
14
+ dist/
15
+ build/
16
+ .parcel-cache/
17
+
18
+ .toposync-data/
19
+ .toposync-processor-data
20
+ toposync-data/
21
+
22
+ *.log
23
+
24
+ *.ignore.md
25
+ ignore/
26
+
27
+ # Playwright
28
+ test-results/
29
+ playwright-report/
30
+ yolo*.pt
31
+
32
+ # Streaming extension engines are downloaded at runtime.
33
+ extensions/streaming/src/toposync_ext_streaming/bin/mediamtx/**/mediamtx*
34
+ extensions/streaming/src/toposync_ext_streaming/bin/ffmpeg/**/ffmpeg*
35
+
36
+ # Vision model artifacts are provisioned locally and must not be committed.
37
+ extensions/vision/models/
38
+
39
+ *.temporary.*
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mateus Calza
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: toposync-ext-cameras
3
+ Version: 0.1.1
4
+ Summary: Toposync first-party extension: RTSP cameras and camera pipeline operators.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: numpy>=1.26
9
+ Requires-Dist: opencv-python-headless>=4.10
10
+ Requires-Dist: pillow<13,>=10
11
+ Requires-Dist: toposync-core>=0.3.0
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Toposync Cameras extension
15
+
16
+ First-party extension focused on camera integration for the global Pipelines runtime.
17
+
18
+ ## What it provides
19
+
20
+ - RTSP camera settings and indexing (`/api/cameras/index`)
21
+ - RTSP snapshot endpoints used by UI/tools
22
+ - Control-point-set mapping endpoint for camera/composition interpolation
23
+ - Camera pipeline operators registry integration
24
+ - Camera element/editor UI in the composition
25
+
26
+ The old per-camera detections runtime (`/api/cameras/detections/*`, `cameras.tracking`, and `toposync_ext_cameras.processor_server`) is no longer part of this extension.
27
+
28
+ ## APIs
29
+
30
+ - `GET /api/cameras/index`
31
+ - `POST /api/cameras/rtsp/snapshot`
32
+ - `GET /api/cameras/cameras/{camera_id}/snapshot`
33
+ - `POST /api/cameras/control_points/map`
34
+
35
+ `camera.camera_mapping` and the editor now use `control_point_sets` as the canonical mapping model:
36
+
37
+ - fixed camera: one set with `pose_reference = null`
38
+ - PTZ camera: one or more sets, optionally bound to a `pose_reference`
39
+ - preview API: receives a single `control_point_set` payload and maps `image <-> world`
40
+
41
+ ## Pipeline operators (registered by this extension)
42
+
43
+ - `camera.source`
44
+ - `camera.motion_gate`
45
+ - `camera.object_crop`
46
+ - `camera.camera_mapping`
47
+ - `camera.area_restriction`
48
+ - `camera.velocity_estimation`
49
+ - `camera.best_frame_selector`
50
+
51
+ Public vision operators are registered by the `com.toposync.vision` extension:
52
+
53
+ - `vision.detect`
54
+ - `vision.track`
55
+
56
+ Legacy vendor-specific YOLO/Ultralytics runtimes are not part of the official first-party path in this extension. If you need one of those integrations in the future, ship it as a separate package and keep `vision.detect` / `vision.track` as the public operator contract.
57
+
58
+ ## Dependencies
59
+
60
+ - `ffmpeg` must be available in `PATH` for snapshot capture.
61
+ - OpenCV is required by frame/motion processing:
62
+ - `uv pip install opencv-python-headless`
63
+ - Vision runtimes are optional and can be installed from `extensions/vision`.
64
+
65
+ ## Snapshot tuning
66
+
67
+ - `TOPOSYNC_CAMERA_SNAPSHOT_TTL_S` (default: `0.8`)
68
+ - `TOPOSYNC_CAMERA_SNAPSHOT_FFMPEG_CONCURRENCY` (default: `2`)
69
+
70
+ ## RTSP note
71
+
72
+ Some cameras expose `/stream1` and `/stream2`. If `/stream1` is unstable for snapshots, configure `rtsp_url` with the substream (`/stream2`) explicitly.
@@ -0,0 +1,59 @@
1
+ # Toposync Cameras extension
2
+
3
+ First-party extension focused on camera integration for the global Pipelines runtime.
4
+
5
+ ## What it provides
6
+
7
+ - RTSP camera settings and indexing (`/api/cameras/index`)
8
+ - RTSP snapshot endpoints used by UI/tools
9
+ - Control-point-set mapping endpoint for camera/composition interpolation
10
+ - Camera pipeline operators registry integration
11
+ - Camera element/editor UI in the composition
12
+
13
+ The old per-camera detections runtime (`/api/cameras/detections/*`, `cameras.tracking`, and `toposync_ext_cameras.processor_server`) is no longer part of this extension.
14
+
15
+ ## APIs
16
+
17
+ - `GET /api/cameras/index`
18
+ - `POST /api/cameras/rtsp/snapshot`
19
+ - `GET /api/cameras/cameras/{camera_id}/snapshot`
20
+ - `POST /api/cameras/control_points/map`
21
+
22
+ `camera.camera_mapping` and the editor now use `control_point_sets` as the canonical mapping model:
23
+
24
+ - fixed camera: one set with `pose_reference = null`
25
+ - PTZ camera: one or more sets, optionally bound to a `pose_reference`
26
+ - preview API: receives a single `control_point_set` payload and maps `image <-> world`
27
+
28
+ ## Pipeline operators (registered by this extension)
29
+
30
+ - `camera.source`
31
+ - `camera.motion_gate`
32
+ - `camera.object_crop`
33
+ - `camera.camera_mapping`
34
+ - `camera.area_restriction`
35
+ - `camera.velocity_estimation`
36
+ - `camera.best_frame_selector`
37
+
38
+ Public vision operators are registered by the `com.toposync.vision` extension:
39
+
40
+ - `vision.detect`
41
+ - `vision.track`
42
+
43
+ Legacy vendor-specific YOLO/Ultralytics runtimes are not part of the official first-party path in this extension. If you need one of those integrations in the future, ship it as a separate package and keep `vision.detect` / `vision.track` as the public operator contract.
44
+
45
+ ## Dependencies
46
+
47
+ - `ffmpeg` must be available in `PATH` for snapshot capture.
48
+ - OpenCV is required by frame/motion processing:
49
+ - `uv pip install opencv-python-headless`
50
+ - Vision runtimes are optional and can be installed from `extensions/vision`.
51
+
52
+ ## Snapshot tuning
53
+
54
+ - `TOPOSYNC_CAMERA_SNAPSHOT_TTL_S` (default: `0.8`)
55
+ - `TOPOSYNC_CAMERA_SNAPSHOT_FFMPEG_CONCURRENCY` (default: `2`)
56
+
57
+ ## RTSP note
58
+
59
+ Some cameras expose `/stream1` and `/stream2`. If `/stream1` is unstable for snapshots, configure `rtsp_url` with the substream (`/stream2`) explicitly.
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "toposync-ext-cameras"
3
+ version = "0.1.1"
4
+ description = "Toposync first-party extension: RTSP cameras and camera pipeline operators."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ dependencies = ["toposync-core>=0.3.0", "numpy>=1.26", "opencv-python-headless>=4.10", "pillow>=10,<13"]
10
+
11
+ [project.entry-points."toposync.extensions"]
12
+ cameras = "toposync_ext_cameras.plugin:CamerasExtension"
13
+
14
+ [build-system]
15
+ requires = ["hatchling>=1.25"]
16
+ build-backend = "hatchling.build"
17
+
18
+ [tool.hatch.build.targets.wheel]
19
+ packages = ["src/toposync_ext_cameras"]
@@ -0,0 +1 @@
1
+ __all__ = ["CamerasExtension"]
@@ -0,0 +1,12 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "com.toposync.cameras",
4
+ "name": "Cameras",
5
+ "version": "0.1.1",
6
+ "frontend": {
7
+ "kind": "module-federation",
8
+ "remote_entry": "remoteEntry.js",
9
+ "scope": "cameras",
10
+ "module": "./activate"
11
+ }
12
+ }
@@ -0,0 +1,28 @@
1
+ """Minimal ONVIF helpers (SOAP + WS-Security UsernameToken + WS-Discovery) used by the Cameras extension.
2
+
3
+ This intentionally avoids external dependencies to keep the extension lightweight.
4
+ """
5
+
6
+ from .client import (
7
+ OnvifClient,
8
+ OnvifError,
9
+ OnvifProfile,
10
+ OnvifPtzPreset,
11
+ OnvifPtzStatus,
12
+ normalize_onvif_xaddr,
13
+ normalize_rtsp_url,
14
+ )
15
+ from .discovery import OnvifDiscoveredDevice, discover_onvif_devices, parse_ws_discovery_probe_matches
16
+
17
+ __all__ = [
18
+ "OnvifClient",
19
+ "OnvifError",
20
+ "OnvifProfile",
21
+ "OnvifPtzPreset",
22
+ "OnvifPtzStatus",
23
+ "OnvifDiscoveredDevice",
24
+ "discover_onvif_devices",
25
+ "parse_ws_discovery_probe_matches",
26
+ "normalize_onvif_xaddr",
27
+ "normalize_rtsp_url",
28
+ ]