toposync-ext-vision 0.1.3__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 (55) hide show
  1. toposync_ext_vision-0.1.3/.gitignore +39 -0
  2. toposync_ext_vision-0.1.3/LICENSE +21 -0
  3. toposync_ext_vision-0.1.3/PKG-INFO +114 -0
  4. toposync_ext_vision-0.1.3/README.md +98 -0
  5. toposync_ext_vision-0.1.3/hatch_build.py +21 -0
  6. toposync_ext_vision-0.1.3/pyproject.toml +35 -0
  7. toposync_ext_vision-0.1.3/src/toposync_ext_vision/__init__.py +3 -0
  8. toposync_ext_vision-0.1.3/src/toposync_ext_vision/extension.json +6 -0
  9. toposync_ext_vision-0.1.3/src/toposync_ext_vision/pipelines/__init__.py +99 -0
  10. toposync_ext_vision-0.1.3/src/toposync_ext_vision/pipelines/operators.py +247 -0
  11. toposync_ext_vision-0.1.3/src/toposync_ext_vision/pipelines/schemas.py +201 -0
  12. toposync_ext_vision-0.1.3/src/toposync_ext_vision/plugin.py +88 -0
  13. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/__init__.py +52 -0
  14. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/artifact_helpers.py +413 -0
  15. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/contracts.py +325 -0
  16. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/diagnostics.py +237 -0
  17. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/__init__.py +21 -0
  18. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/generic_onnx_boxes_parser.py +141 -0
  19. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/generic_segmentation_masks_parser.py +156 -0
  20. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/image_classification_logits_parser.py +102 -0
  21. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/rfdetr_parser.py +97 -0
  22. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/rtmdet_ins_parser.py +194 -0
  23. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/parsers/rtmdet_parser.py +112 -0
  24. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/runtime_backends/__init__.py +27 -0
  25. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/runtime_backends/onnxruntime_backend.py +457 -0
  26. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/runtime_upgrades.py +211 -0
  27. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/__init__.py +13 -0
  28. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/classification.py +170 -0
  29. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/detection.py +267 -0
  30. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/pose.py +308 -0
  31. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/segmentation.py +506 -0
  32. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/tasks/tracking.py +759 -0
  33. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/trackers/__init__.py +59 -0
  34. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/trackers/norfair_tracker.py +195 -0
  35. toposync_ext_vision-0.1.3/src/toposync_ext_vision/processing/trackers/simple_iou_kalman.py +349 -0
  36. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/__init__.py +97 -0
  37. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/artifact_upload.py +104 -0
  38. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/builtin_data.py +125 -0
  39. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/custom_onnx.py +756 -0
  40. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/huggingface.py +580 -0
  41. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/huggingface_recipes.py +454 -0
  42. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/installer.py +789 -0
  43. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/local_build.py +922 -0
  44. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/manifests.py +459 -0
  45. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/model_store.py +183 -0
  46. toposync_ext_vision-0.1.3/src/toposync_ext_vision/registry/recommendations.py +540 -0
  47. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rfdetr_det_medium.json +63 -0
  48. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rfdetr_det_nano.json +63 -0
  49. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rfdetr_det_small.json +63 -0
  50. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_det_medium.json +64 -0
  51. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_det_small.json +64 -0
  52. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_det_tiny.json +64 -0
  53. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_ins_medium.json +60 -0
  54. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_ins_small.json +60 -0
  55. toposync_ext_vision-0.1.3/toposync_ext_vision/manifests/rtmdet_ins_tiny.json +60 -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,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: toposync-ext-vision
3
+ Version: 0.1.3
4
+ Summary: Toposync first-party extension: task-oriented vision operators.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: huggingface-hub<1,>=0.34
9
+ Requires-Dist: norfair<3,>=2.2
10
+ Requires-Dist: numpy<3,>=1.26
11
+ Requires-Dist: onnx<2,>=1.17
12
+ Requires-Dist: pillow<13,>=10
13
+ Requires-Dist: toposync-core>=0.3.0
14
+ Requires-Dist: toposync-ext-cameras>=0.1.0
15
+ Description-Content-Type: text/markdown
16
+
17
+ # Toposync Vision extension
18
+
19
+ First-party extension focused on public task-oriented vision operators for the Pipelines runtime.
20
+
21
+ ## What it provides
22
+
23
+ - `vision.detect`
24
+ - `vision.track`
25
+ - `vision.segment_instances`
26
+ - `vision.pose_estimate` (skeleton only; not launched yet)
27
+
28
+ The public surface is task-based, not vendor-based. The official first-party runtime is ONNX Runtime, with CPU as the default execution path.
29
+
30
+ ## Dependencies
31
+
32
+ - The default `toposync` application bundle includes the first-party ONNX Runtime CPU stack.
33
+ - The GPU-oriented first-party bundles are published separately:
34
+ - `toposync-vision-cuda`
35
+ - `toposync-vision-directml`
36
+ - The official extension package now also includes the first-party tracker stack:
37
+ - `simple_iou_kalman`
38
+ - `norfair`
39
+
40
+ ## Notes
41
+
42
+ - `vision.detect` resolves `ModelManifest` entries and builds an ONNX Runtime backend automatically when `runtime=onnxruntime`.
43
+ - By default, the ONNX Runtime backend prefers `CPUExecutionProvider`. Optional acceleration is opt-in via the `toposync-vision-cuda` / `toposync-vision-directml` bundles or `TOPOSYNC_VISION_ONNXRUNTIME_PROVIDERS`.
44
+ - Manifest files can be loaded from `TOPOSYNC_VISION_MANIFESTS_DIR` or `TOPOSYNC_VISION_MANIFEST_PATHS`.
45
+ - Custom manifests imported from the UI are persisted under `.toposync-data/vision-manifests/` for the selected processing server.
46
+ - Built-in first-party manifests ship inside the wheel, but their ONNX weights do not. When no checkout-local artifact exists, official model ids resolve to `TOPOSYNC_DATA_DIR/vision-models/...` (or `.toposync-data/vision-models/...` by default).
47
+ - The extension now ships a built-in RTMDet detection shortlist in `extensions/vision/manifests/`:
48
+ - `rtmdet_det_tiny`
49
+ - `rtmdet_det_small`
50
+ - `rtmdet_det_medium`
51
+ - The extension now also ships a built-in RF-DETR detection shortlist in `extensions/vision/manifests/`:
52
+ - `rfdetr_det_nano`
53
+ - `rfdetr_det_small`
54
+ - `rfdetr_det_medium`
55
+ - In a source checkout, existing local artifacts under `extensions/vision/models/...` are still honored.
56
+ - In installed environments, official artifacts belong under the managed model store in `TOPOSYNC_DATA_DIR/vision-models/...` and are intentionally not bundled in the published package.
57
+ - The validated manual provisioning flow is documented in `docs/VISION_MODEL_PROVISIONING.md`.
58
+ - The initial assisted-provisioning foundation for RTMDet detection is already exposed in catalog metadata:
59
+ - upstream checkpoint/config/metafile/paper links
60
+ - planned local builder backend
61
+ - planned supported platforms
62
+ - explicit-consent requirement
63
+ - The UI can also trigger installation for models that have an admin-configured source. Supported source env vars are:
64
+ - `TOPOSYNC_VISION_MODEL_SOURCE_<MODEL_ID>`
65
+ - `TOPOSYNC_VISION_MODEL_URL_<MODEL_ID>`
66
+ - `TOPOSYNC_VISION_MODEL_PATH_<MODEL_ID>`
67
+ - `TOPOSYNC_VISION_OFFICIAL_MODEL_SOURCE_DIR`
68
+ - `TOPOSYNC_VISION_OFFICIAL_MODEL_BASE_URL`
69
+ - RTMDet detection now also has an experimental assisted local build path:
70
+ - Linux only in this phase
71
+ - requires a local container runtime (`docker` or `podman`) on the processing server
72
+ - still downloads the upstream checkpoint directly on that machine
73
+ - still validates the exported `end2end.onnx` against the manifest checksum
74
+ - now records provenance per job, including actor, accepted upstream sources, builder metadata, and final ONNX sha256
75
+ - still keeps manual upload as the stable fallback path
76
+ - can be started from the model recovery card or the Processing Servers screen
77
+ - RF-DETR detection now also has an experimental assisted local build path:
78
+ - supports `linux`, `darwin`, and `windows` hosts in this phase
79
+ - uses a host Python builder (`rfdetr[onnx]`) instead of MMDeploy
80
+ - downloads the upstream checkpoint directly on that machine before exporting the ONNX locally
81
+ - keeps manual ONNX upload available as the stable fallback path
82
+ - is prioritized in the operator UI when nothing is installed and the local builder is actually available on that machine
83
+ - Remote download sources are only enabled when the manifest explicitly allows redistribution. The current built-in RTMDet/RTMDet-Ins manifests do not, so the safe first-party flow is local admin-managed copy.
84
+ - Product policy: RTMDet and RTMDet-Ins stay on `guided_upload` for now. RF-DETR is available only through assisted local build in this phase; it is not mirrored, bundled, or redistributed by TopoSync.
85
+ - Product policy: Ultralytics/YOLO is not part of the official first-party vision runtime path.
86
+ - The extension now also ships a built-in RTMDet-Ins segmentation shortlist:
87
+ - `rtmdet_ins_tiny`
88
+ - `rtmdet_ins_small`
89
+ - `rtmdet_ins_medium`
90
+ - RTMDet manifests use the dedicated `mmdet_rtmdet` parser, letterbox preprocessing, and COCO-80 labels.
91
+ - RF-DETR manifests use the dedicated `rfdetr_detr` parser and the official DETR-style `dets` + `labels` ONNX outputs.
92
+ - RTMDet-Ins manifests use the dedicated `mmdet_rtmdet_ins` parser and produce real binary mask artifacts.
93
+ - The processing server status now exposes:
94
+ - heuristic hardware recommendations
95
+ - runtime upgrade suggestions for CUDA / DirectML bundles
96
+ - a per-task model catalog with availability (`available`, `manifest_only`, `incompatible`)
97
+ - installation capability and progress for models that can be fetched/copied automatically
98
+ - badges such as `recommended`, `fastest`, `best_quality`, `edge`
99
+ - `vision.detect` can either filter the stream to packets that contain detections (`emit_mode="events"`) or keep every frame annotated (`emit_mode="annotate"`).
100
+ - `vision.track` is now first-party and detector-agnostic: it consumes `payload["vision"]["detections"]`.
101
+ - Every `TrackedObject` now carries `camera_id`, and can optionally carry `world_anchor` plus `appearance_embedding_artifact_name` for future multi-camera association work.
102
+ - `vision.segment_instances` writes `payload["vision"]["segmentations"]`, attaches mask artifacts when enabled, and exposes the top mask as the semantic image key `mask`.
103
+ - `vision.pose_estimate` already reserves the public operator id, config schema, packet contract, and `task=pose` registry path so future pose models can land without breaking the architecture.
104
+ - Tracking contracts already carry optional keypoints, so future pose-aware trackers do not require a structural rewrite.
105
+ - `ModelManifest` now also accepts optional `capabilities` such as `reid`, so future re-identification models can be cataloged without changing the registry shape.
106
+ - The pipeline editor now chooses models by task, not framework/vendor id. Basic setup is guided for common users, while advanced details expose runtime/model internals and custom manifest import when needed.
107
+ - The first-party tracking backends are:
108
+ - `simple_iou_kalman`
109
+ - `norfair`
110
+ - `vision.track` supports:
111
+ - `emit_mode="events"` for split-stream lifecycle packets per object
112
+ - `emit_mode="annotate"` for frame passthrough with `payload["vision"]["tracks"]`
113
+ - `vision.detect` keeps per-object lifecycle semantics out of scope; use `vision.track` when you need temporal identity instead of simple frame filtering.
114
+ - Crop by bbox remains in `com.toposync.cameras` as `camera.object_crop`; it is not instance segmentation.
@@ -0,0 +1,98 @@
1
+ # Toposync Vision extension
2
+
3
+ First-party extension focused on public task-oriented vision operators for the Pipelines runtime.
4
+
5
+ ## What it provides
6
+
7
+ - `vision.detect`
8
+ - `vision.track`
9
+ - `vision.segment_instances`
10
+ - `vision.pose_estimate` (skeleton only; not launched yet)
11
+
12
+ The public surface is task-based, not vendor-based. The official first-party runtime is ONNX Runtime, with CPU as the default execution path.
13
+
14
+ ## Dependencies
15
+
16
+ - The default `toposync` application bundle includes the first-party ONNX Runtime CPU stack.
17
+ - The GPU-oriented first-party bundles are published separately:
18
+ - `toposync-vision-cuda`
19
+ - `toposync-vision-directml`
20
+ - The official extension package now also includes the first-party tracker stack:
21
+ - `simple_iou_kalman`
22
+ - `norfair`
23
+
24
+ ## Notes
25
+
26
+ - `vision.detect` resolves `ModelManifest` entries and builds an ONNX Runtime backend automatically when `runtime=onnxruntime`.
27
+ - By default, the ONNX Runtime backend prefers `CPUExecutionProvider`. Optional acceleration is opt-in via the `toposync-vision-cuda` / `toposync-vision-directml` bundles or `TOPOSYNC_VISION_ONNXRUNTIME_PROVIDERS`.
28
+ - Manifest files can be loaded from `TOPOSYNC_VISION_MANIFESTS_DIR` or `TOPOSYNC_VISION_MANIFEST_PATHS`.
29
+ - Custom manifests imported from the UI are persisted under `.toposync-data/vision-manifests/` for the selected processing server.
30
+ - Built-in first-party manifests ship inside the wheel, but their ONNX weights do not. When no checkout-local artifact exists, official model ids resolve to `TOPOSYNC_DATA_DIR/vision-models/...` (or `.toposync-data/vision-models/...` by default).
31
+ - The extension now ships a built-in RTMDet detection shortlist in `extensions/vision/manifests/`:
32
+ - `rtmdet_det_tiny`
33
+ - `rtmdet_det_small`
34
+ - `rtmdet_det_medium`
35
+ - The extension now also ships a built-in RF-DETR detection shortlist in `extensions/vision/manifests/`:
36
+ - `rfdetr_det_nano`
37
+ - `rfdetr_det_small`
38
+ - `rfdetr_det_medium`
39
+ - In a source checkout, existing local artifacts under `extensions/vision/models/...` are still honored.
40
+ - In installed environments, official artifacts belong under the managed model store in `TOPOSYNC_DATA_DIR/vision-models/...` and are intentionally not bundled in the published package.
41
+ - The validated manual provisioning flow is documented in `docs/VISION_MODEL_PROVISIONING.md`.
42
+ - The initial assisted-provisioning foundation for RTMDet detection is already exposed in catalog metadata:
43
+ - upstream checkpoint/config/metafile/paper links
44
+ - planned local builder backend
45
+ - planned supported platforms
46
+ - explicit-consent requirement
47
+ - The UI can also trigger installation for models that have an admin-configured source. Supported source env vars are:
48
+ - `TOPOSYNC_VISION_MODEL_SOURCE_<MODEL_ID>`
49
+ - `TOPOSYNC_VISION_MODEL_URL_<MODEL_ID>`
50
+ - `TOPOSYNC_VISION_MODEL_PATH_<MODEL_ID>`
51
+ - `TOPOSYNC_VISION_OFFICIAL_MODEL_SOURCE_DIR`
52
+ - `TOPOSYNC_VISION_OFFICIAL_MODEL_BASE_URL`
53
+ - RTMDet detection now also has an experimental assisted local build path:
54
+ - Linux only in this phase
55
+ - requires a local container runtime (`docker` or `podman`) on the processing server
56
+ - still downloads the upstream checkpoint directly on that machine
57
+ - still validates the exported `end2end.onnx` against the manifest checksum
58
+ - now records provenance per job, including actor, accepted upstream sources, builder metadata, and final ONNX sha256
59
+ - still keeps manual upload as the stable fallback path
60
+ - can be started from the model recovery card or the Processing Servers screen
61
+ - RF-DETR detection now also has an experimental assisted local build path:
62
+ - supports `linux`, `darwin`, and `windows` hosts in this phase
63
+ - uses a host Python builder (`rfdetr[onnx]`) instead of MMDeploy
64
+ - downloads the upstream checkpoint directly on that machine before exporting the ONNX locally
65
+ - keeps manual ONNX upload available as the stable fallback path
66
+ - is prioritized in the operator UI when nothing is installed and the local builder is actually available on that machine
67
+ - Remote download sources are only enabled when the manifest explicitly allows redistribution. The current built-in RTMDet/RTMDet-Ins manifests do not, so the safe first-party flow is local admin-managed copy.
68
+ - Product policy: RTMDet and RTMDet-Ins stay on `guided_upload` for now. RF-DETR is available only through assisted local build in this phase; it is not mirrored, bundled, or redistributed by TopoSync.
69
+ - Product policy: Ultralytics/YOLO is not part of the official first-party vision runtime path.
70
+ - The extension now also ships a built-in RTMDet-Ins segmentation shortlist:
71
+ - `rtmdet_ins_tiny`
72
+ - `rtmdet_ins_small`
73
+ - `rtmdet_ins_medium`
74
+ - RTMDet manifests use the dedicated `mmdet_rtmdet` parser, letterbox preprocessing, and COCO-80 labels.
75
+ - RF-DETR manifests use the dedicated `rfdetr_detr` parser and the official DETR-style `dets` + `labels` ONNX outputs.
76
+ - RTMDet-Ins manifests use the dedicated `mmdet_rtmdet_ins` parser and produce real binary mask artifacts.
77
+ - The processing server status now exposes:
78
+ - heuristic hardware recommendations
79
+ - runtime upgrade suggestions for CUDA / DirectML bundles
80
+ - a per-task model catalog with availability (`available`, `manifest_only`, `incompatible`)
81
+ - installation capability and progress for models that can be fetched/copied automatically
82
+ - badges such as `recommended`, `fastest`, `best_quality`, `edge`
83
+ - `vision.detect` can either filter the stream to packets that contain detections (`emit_mode="events"`) or keep every frame annotated (`emit_mode="annotate"`).
84
+ - `vision.track` is now first-party and detector-agnostic: it consumes `payload["vision"]["detections"]`.
85
+ - Every `TrackedObject` now carries `camera_id`, and can optionally carry `world_anchor` plus `appearance_embedding_artifact_name` for future multi-camera association work.
86
+ - `vision.segment_instances` writes `payload["vision"]["segmentations"]`, attaches mask artifacts when enabled, and exposes the top mask as the semantic image key `mask`.
87
+ - `vision.pose_estimate` already reserves the public operator id, config schema, packet contract, and `task=pose` registry path so future pose models can land without breaking the architecture.
88
+ - Tracking contracts already carry optional keypoints, so future pose-aware trackers do not require a structural rewrite.
89
+ - `ModelManifest` now also accepts optional `capabilities` such as `reid`, so future re-identification models can be cataloged without changing the registry shape.
90
+ - The pipeline editor now chooses models by task, not framework/vendor id. Basic setup is guided for common users, while advanced details expose runtime/model internals and custom manifest import when needed.
91
+ - The first-party tracking backends are:
92
+ - `simple_iou_kalman`
93
+ - `norfair`
94
+ - `vision.track` supports:
95
+ - `emit_mode="events"` for split-stream lifecycle packets per object
96
+ - `emit_mode="annotate"` for frame passthrough with `payload["vision"]["tracks"]`
97
+ - `vision.detect` keeps per-object lifecycle semantics out of scope; use `vision.track` when you need temporal identity instead of simple frame filtering.
98
+ - Crop by bbox remains in `com.toposync.cameras` as `camera.object_crop`; it is not instance segmentation.
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
6
+
7
+
8
+ class CustomBuildHook(BuildHookInterface):
9
+ def initialize(self, version: str, build_data: dict[str, object]) -> None:
10
+ root = Path(self.root)
11
+ manifests_dir = root / "manifests"
12
+ if not manifests_dir.is_dir():
13
+ manifests_dir = root / "toposync_ext_vision" / "manifests"
14
+ if not manifests_dir.is_dir():
15
+ raise RuntimeError("Missing built-in manifest directory for toposync-ext-vision")
16
+
17
+ force_include = build_data.setdefault("force_include", {})
18
+ if not isinstance(force_include, dict):
19
+ raise TypeError("build_data.force_include must be a dictionary")
20
+
21
+ force_include[str(manifests_dir)] = "toposync_ext_vision/manifests"
@@ -0,0 +1,35 @@
1
+ [project]
2
+ name = "toposync-ext-vision"
3
+ version = "0.1.3"
4
+ description = "Toposync first-party extension: task-oriented vision operators."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.11"
9
+ dependencies = [
10
+ "toposync-core>=0.3.0",
11
+ "toposync-ext-cameras>=0.1.0",
12
+ "numpy>=1.26,<3",
13
+ "norfair>=2.2,<3",
14
+ "onnx>=1.17,<2",
15
+ "huggingface_hub>=0.34,<1",
16
+ "pillow>=10,<13",
17
+ ]
18
+ [project.entry-points."toposync.extensions"]
19
+ vision = "toposync_ext_vision.plugin:VisionExtension"
20
+
21
+ [build-system]
22
+ requires = ["hatchling>=1.25"]
23
+ build-backend = "hatchling.build"
24
+
25
+ [tool.hatch.build.hooks.custom]
26
+ path = "hatch_build.py"
27
+
28
+ [tool.hatch.build.targets.sdist]
29
+ exclude = [
30
+ "/models",
31
+ "/models/**",
32
+ ]
33
+
34
+ [tool.hatch.build.targets.wheel]
35
+ packages = ["src/toposync_ext_vision"]
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __all__ = []
@@ -0,0 +1,6 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "com.toposync.vision",
4
+ "name": "Vision",
5
+ "version": "0.1.3"
6
+ }
@@ -0,0 +1,99 @@
1
+ from __future__ import annotations
2
+
3
+ from importlib import import_module
4
+
5
+ _EXPORTS: dict[str, tuple[str, str]] = {
6
+ "ClassificationLabelScore": ("toposync_ext_vision.processing", "ClassificationLabelScore"),
7
+ "ClassifierBackend": ("toposync_ext_vision.processing", "ClassifierBackend"),
8
+ "DetectionObject": ("toposync_ext_vision.processing", "DetectionObject"),
9
+ "DetectorBackend": ("toposync_ext_vision.processing", "DetectorBackend"),
10
+ "ImageClassificationResult": ("toposync_ext_vision.processing", "ImageClassificationResult"),
11
+ "ModelManifest": ("toposync_ext_vision.registry", "ModelManifest"),
12
+ "ModelRegistry": ("toposync_ext_vision.registry", "ModelRegistry"),
13
+ "ModelRegistryError": ("toposync_ext_vision.registry", "ModelRegistryError"),
14
+ "OnnxRuntimeClassificationBackend": (
15
+ "toposync_ext_vision.processing.runtime_backends",
16
+ "OnnxRuntimeClassificationBackend",
17
+ ),
18
+ "OnnxRuntimeDetectorBackend": (
19
+ "toposync_ext_vision.processing.runtime_backends",
20
+ "OnnxRuntimeDetectorBackend",
21
+ ),
22
+ "OnnxRuntimeSegmentationBackend": (
23
+ "toposync_ext_vision.processing.runtime_backends",
24
+ "OnnxRuntimeSegmentationBackend",
25
+ ),
26
+ "PoseBackend": ("toposync_ext_vision.processing", "PoseBackend"),
27
+ "PoseObject": ("toposync_ext_vision.processing", "PoseObject"),
28
+ "SegmentationInstance": ("toposync_ext_vision.processing", "SegmentationInstance"),
29
+ "TrackedObject": ("toposync_ext_vision.processing", "TrackedObject"),
30
+ "VisionRuntimeFactory": ("toposync_ext_vision.processing", "VisionRuntimeFactory"),
31
+ "available_tracker_backends": ("toposync_ext_vision.processing", "available_tracker_backends"),
32
+ "build_tracker_backend": ("toposync_ext_vision.processing", "build_tracker_backend"),
33
+ "build_segmenter_backend": (
34
+ "toposync_ext_vision.processing",
35
+ "build_segmenter_backend",
36
+ ),
37
+ "build_classifier_backend": (
38
+ "toposync_ext_vision.processing.runtime_backends",
39
+ "build_classifier_backend",
40
+ ),
41
+ "build_pose_backend": (
42
+ "toposync_ext_vision.processing.runtime_backends",
43
+ "build_pose_backend",
44
+ ),
45
+ "VisionClassifyImageConfig": (
46
+ "toposync_ext_vision.pipelines.schemas",
47
+ "VisionClassifyImageConfig",
48
+ ),
49
+ "VisionDetectConfig": ("toposync_ext_vision.pipelines.schemas", "VisionDetectConfig"),
50
+ "VisionPoseEstimateConfig": (
51
+ "toposync_ext_vision.pipelines.schemas",
52
+ "VisionPoseEstimateConfig",
53
+ ),
54
+ "VisionSegmentInstancesConfig": (
55
+ "toposync_ext_vision.pipelines.schemas",
56
+ "VisionSegmentInstancesConfig",
57
+ ),
58
+ "VisionTrackConfig": ("toposync_ext_vision.pipelines.schemas", "VisionTrackConfig"),
59
+ "VisionClassifyImageRuntime": (
60
+ "toposync_ext_vision.processing.tasks",
61
+ "VisionClassifyImageRuntime",
62
+ ),
63
+ "VisionDetectRuntime": ("toposync_ext_vision.processing.tasks", "VisionDetectRuntime"),
64
+ "VisionPoseEstimateRuntime": (
65
+ "toposync_ext_vision.processing.tasks",
66
+ "VisionPoseEstimateRuntime",
67
+ ),
68
+ "VisionSegmentInstancesRuntime": (
69
+ "toposync_ext_vision.processing.tasks",
70
+ "VisionSegmentInstancesRuntime",
71
+ ),
72
+ "VisionTrackRuntime": ("toposync_ext_vision.processing.tasks", "VisionTrackRuntime"),
73
+ "available_onnxruntime_execution_providers": (
74
+ "toposync_ext_vision.processing.runtime_backends",
75
+ "available_onnxruntime_execution_providers",
76
+ ),
77
+ "build_detector_backend": (
78
+ "toposync_ext_vision.processing.runtime_backends",
79
+ "build_detector_backend",
80
+ ),
81
+ "build_default_model_registry": ("toposync_ext_vision.registry", "build_default_model_registry"),
82
+ "collect_vision_diagnostics": ("toposync_ext_vision.processing", "collect_vision_diagnostics"),
83
+ "get_last_benchmark": ("toposync_ext_vision.processing", "get_last_benchmark"),
84
+ "register_vision_pipeline_operators": (
85
+ "toposync_ext_vision.pipelines.operators",
86
+ "register_vision_pipeline_operators",
87
+ ),
88
+ }
89
+
90
+ __all__ = list(_EXPORTS)
91
+
92
+
93
+ def __getattr__(name: str):
94
+ target = _EXPORTS.get(name)
95
+ if target is None:
96
+ raise AttributeError(name)
97
+ module_name, attr_name = target
98
+ module = import_module(module_name)
99
+ return getattr(module, attr_name)