@trillboards/edge-sdk 0.2.178 → 0.2.181

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 (46) hide show
  1. package/THIRD-PARTY-NOTICES.md +220 -0
  2. package/deploy/detector/bench/actor-appearance-qualified-v1.json +106 -0
  3. package/deploy/detector/bench/actor-appearance.md +52 -0
  4. package/deploy/detector/bench/export_actor_appearance.py +134 -0
  5. package/deploy/detector/bench/qualify_actor_appearance.py +77 -0
  6. package/deploy/detector/bench/qualify_actor_appearance_client.cjs +50 -0
  7. package/deploy/detector/bench/qualify_actor_appearance_wire.py +170 -0
  8. package/deploy/detector/bench/requirements-appearance-export.txt +4 -0
  9. package/deploy/detector/pyproject.toml +1 -1
  10. package/deploy/detector/tests/fixtures/actor-appearance-original-g326-v1.json +27105 -0
  11. package/deploy/detector/tests/test_actor_appearance_tracking.py +196 -0
  12. package/deploy/detector/tests/test_appearance_wire.py +80 -0
  13. package/deploy/detector/tests/test_loader.py +9 -7
  14. package/deploy/detector/trillboards_detector/_version.py +2 -2
  15. package/deploy/detector/trillboards_detector/actor_identity.py +323 -0
  16. package/deploy/detector/trillboards_detector/actor_tracking.py +163 -1
  17. package/deploy/detector/trillboards_detector/appearance.py +149 -0
  18. package/deploy/detector/trillboards_detector/loader.py +6 -0
  19. package/deploy/detector/trillboards_detector/registry.py +30 -1
  20. package/deploy/detector/trillboards_detector/server.py +56 -1
  21. package/deploy/detector/trillboards_detector/tasks.py +7 -1
  22. package/dist/ActorAppearance.d.ts +13 -0
  23. package/dist/ActorAppearance.d.ts.map +1 -0
  24. package/dist/ActorAppearance.js +17 -0
  25. package/dist/ActorAppearance.js.map +1 -0
  26. package/dist/ActorPerception.d.ts +2 -0
  27. package/dist/ActorPerception.d.ts.map +1 -1
  28. package/dist/ActorPerception.js +12 -5
  29. package/dist/ActorPerception.js.map +1 -1
  30. package/dist/ActorTracking.d.ts +3 -1
  31. package/dist/ActorTracking.d.ts.map +1 -1
  32. package/dist/ActorTracking.js +10 -3
  33. package/dist/ActorTracking.js.map +1 -1
  34. package/dist/EdgeAgent.js +1 -1
  35. package/dist/LocalDetectorClient.d.ts +2 -1
  36. package/dist/LocalDetectorClient.d.ts.map +1 -1
  37. package/dist/LocalDetectorClient.js +9 -2
  38. package/dist/LocalDetectorClient.js.map +1 -1
  39. package/dist/RuntimeModelSelection.d.ts.map +1 -1
  40. package/dist/RuntimeModelSelection.js +15 -1
  41. package/dist/RuntimeModelSelection.js.map +1 -1
  42. package/dist/diagnose.d.ts +1 -1
  43. package/dist/diagnose.js +1 -1
  44. package/package.json +2 -2
  45. package/retained/__tests__/actor-perception.test.cjs +29 -6
  46. package/retained/manager.cjs +20 -9
@@ -98,3 +98,223 @@ is altered, its version and configuration strings are untouched, and it imposes
98
98
  no restriction on anyone — a recipient remains free to strip the signature,
99
99
  replace the binary, or rebuild it from the Corresponding Source above. Nothing
100
100
  in the product requires `bin\ffmpeg.exe` to be signed in order to run.
101
+
102
+ ---
103
+
104
+ ## Intel Open Model Zoo person appearance
105
+
106
+ The optional person_reid_osnet_0277 native helper uses Intel's
107
+ person-reidentification-retail-0277 weights. The trained weights are unchanged;
108
+ the official FP32 OpenVINO IR is converted to ONNX opset 17. This model supplies
109
+ person appearance descriptors for tracking continuity and owns no action field.
110
+
111
+ Copyright (c) 2023-2024 Intel Corporation.
112
+
113
+ Source and immutable checksums:
114
+ https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/person-reidentification-retail-0277/model.yml
115
+
116
+ Apache License, Version 2.0, reproduced from the model's official license:
117
+
118
+ ```
119
+ Apache License
120
+ Version 2.0, January 2004
121
+ http://www.apache.org/licenses/
122
+
123
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
124
+
125
+ 1. Definitions.
126
+
127
+ "License" shall mean the terms and conditions for use, reproduction,
128
+ and distribution as defined by Sections 1 through 9 of this document.
129
+
130
+ "Licensor" shall mean the copyright owner or entity authorized by
131
+ the copyright owner that is granting the License.
132
+
133
+ "Legal Entity" shall mean the union of the acting entity and all
134
+ other entities that control, are controlled by, or are under common
135
+ control with that entity. For the purposes of this definition,
136
+ "control" means (i) the power, direct or indirect, to cause the
137
+ direction or management of such entity, whether by contract or
138
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
139
+ outstanding shares, or (iii) beneficial ownership of such entity.
140
+
141
+ "You" (or "Your") shall mean an individual or Legal Entity
142
+ exercising permissions granted by this License.
143
+
144
+ "Source" form shall mean the preferred form for making modifications,
145
+ including but not limited to software source code, documentation
146
+ source, and configuration files.
147
+
148
+ "Object" form shall mean any form resulting from mechanical
149
+ transformation or translation of a Source form, including but
150
+ not limited to compiled object code, generated documentation,
151
+ and conversions to other media types.
152
+
153
+ "Work" shall mean the work of authorship, whether in Source or
154
+ Object form, made available under the License, as indicated by a
155
+ copyright notice that is included in or attached to the work
156
+ (an example is provided in the Appendix below).
157
+
158
+ "Derivative Works" shall mean any work, whether in Source or Object
159
+ form, that is based on (or derived from) the Work and for which the
160
+ editorial revisions, annotations, elaborations, or other modifications
161
+ represent, as a whole, an original work of authorship. For the purposes
162
+ of this License, Derivative Works shall not include works that remain
163
+ separable from, or merely link (or bind by name) to the interfaces of,
164
+ the Work and Derivative Works thereof.
165
+
166
+ "Contribution" shall mean any work of authorship, including
167
+ the original version of the Work and any modifications or additions
168
+ to that Work or Derivative Works thereof, that is intentionally
169
+ submitted to Licensor for inclusion in the Work by the copyright owner
170
+ or by an individual or Legal Entity authorized to submit on behalf of
171
+ the copyright owner. For the purposes of this definition, "submitted"
172
+ means any form of electronic, verbal, or written communication sent
173
+ to the Licensor or its representatives, including but not limited to
174
+ communication on electronic mailing lists, source code control systems,
175
+ and issue tracking systems that are managed by, or on behalf of, the
176
+ Licensor for the purpose of discussing and improving the Work, but
177
+ excluding communication that is conspicuously marked or otherwise
178
+ designated in writing by the copyright owner as "Not a Contribution."
179
+
180
+ "Contributor" shall mean Licensor and any individual or Legal Entity
181
+ on behalf of whom a Contribution has been received by Licensor and
182
+ subsequently incorporated within the Work.
183
+
184
+ 2. Grant of Copyright License. Subject to the terms and conditions of
185
+ this License, each Contributor hereby grants to You a perpetual,
186
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
187
+ copyright license to reproduce, prepare Derivative Works of,
188
+ publicly display, publicly perform, sublicense, and distribute the
189
+ Work and such Derivative Works in Source or Object form.
190
+
191
+ 3. Grant of Patent License. Subject to the terms and conditions of
192
+ this License, each Contributor hereby grants to You a perpetual,
193
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
194
+ (except as stated in this section) patent license to make, have made,
195
+ use, offer to sell, sell, import, and otherwise transfer the Work,
196
+ where such license applies only to those patent claims licensable
197
+ by such Contributor that are necessarily infringed by their
198
+ Contribution(s) alone or by combination of their Contribution(s)
199
+ with the Work to which such Contribution(s) was submitted. If You
200
+ institute patent litigation against any entity (including a
201
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
202
+ or a Contribution incorporated within the Work constitutes direct
203
+ or contributory patent infringement, then any patent licenses
204
+ granted to You under this License for that Work shall terminate
205
+ as of the date such litigation is filed.
206
+
207
+ 4. Redistribution. You may reproduce and distribute copies of the
208
+ Work or Derivative Works thereof in any medium, with or without
209
+ modifications, and in Source or Object form, provided that You
210
+ meet the following conditions:
211
+
212
+ (a) You must give any other recipients of the Work or
213
+ Derivative Works a copy of this License; and
214
+
215
+ (b) You must cause any modified files to carry prominent notices
216
+ stating that You changed the files; and
217
+
218
+ (c) You must retain, in the Source form of any Derivative Works
219
+ that You distribute, all copyright, patent, trademark, and
220
+ attribution notices from the Source form of the Work,
221
+ excluding those notices that do not pertain to any part of
222
+ the Derivative Works; and
223
+
224
+ (d) If the Work includes a "NOTICE" text file as part of its
225
+ distribution, then any Derivative Works that You distribute must
226
+ include a readable copy of the attribution notices contained
227
+ within such NOTICE file, excluding those notices that do not
228
+ pertain to any part of the Derivative Works, in at least one
229
+ of the following places: within a NOTICE text file distributed
230
+ as part of the Derivative Works; within the Source form or
231
+ documentation, if provided along with the Derivative Works; or,
232
+ within a display generated by the Derivative Works, if and
233
+ wherever such third-party notices normally appear. The contents
234
+ of the NOTICE file are for informational purposes only and
235
+ do not modify the License. You may add Your own attribution
236
+ notices within Derivative Works that You distribute, alongside
237
+ or as an addendum to the NOTICE text from the Work, provided
238
+ that such additional attribution notices cannot be construed
239
+ as modifying the License.
240
+
241
+ You may add Your own copyright statement to Your modifications and
242
+ may provide additional or different license terms and conditions
243
+ for use, reproduction, or distribution of Your modifications, or
244
+ for any such Derivative Works as a whole, provided Your use,
245
+ reproduction, and distribution of the Work otherwise complies with
246
+ the conditions stated in this License.
247
+
248
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
249
+ any Contribution intentionally submitted for inclusion in the Work
250
+ by You to the Licensor shall be under the terms and conditions of
251
+ this License, without any additional terms or conditions.
252
+ Notwithstanding the above, nothing herein shall supersede or modify
253
+ the terms of any separate license agreement you may have executed
254
+ with Licensor regarding such Contributions.
255
+
256
+ 6. Trademarks. This License does not grant permission to use the trade
257
+ names, trademarks, service marks, or product names of the Licensor,
258
+ except as required for reasonable and customary use in describing the
259
+ origin of the Work and reproducing the content of the NOTICE file.
260
+
261
+ 7. Disclaimer of Warranty. Unless required by applicable law or
262
+ agreed to in writing, Licensor provides the Work (and each
263
+ Contributor provides its Contributions) on an "AS IS" BASIS,
264
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
265
+ implied, including, without limitation, any warranties or conditions
266
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
267
+ PARTICULAR PURPOSE. You are solely responsible for determining the
268
+ appropriateness of using or redistributing the Work and assume any
269
+ risks associated with Your exercise of permissions under this License.
270
+
271
+ 8. Limitation of Liability. In no event and under no legal theory,
272
+ whether in tort (including negligence), contract, or otherwise,
273
+ unless required by applicable law (such as deliberate and grossly
274
+ negligent acts) or agreed to in writing, shall any Contributor be
275
+ liable to You for damages, including any direct, indirect, special,
276
+ incidental, or consequential damages of any character arising as a
277
+ result of this License or out of the use or inability to use the
278
+ Work (including but not limited to damages for loss of goodwill,
279
+ work stoppage, computer failure or malfunction, or any and all
280
+ other commercial damages or losses), even if such Contributor
281
+ has been advised of the possibility of such damages.
282
+
283
+ 9. Accepting Warranty or Additional Liability. While redistributing
284
+ the Work or Derivative Works thereof, You may choose to offer,
285
+ and charge a fee for, acceptance of support, warranty, indemnity,
286
+ or other liability obligations and/or rights consistent with this
287
+ License. However, in accepting such obligations, You may act only
288
+ on Your own behalf and on Your sole responsibility, not on behalf
289
+ of any other Contributor, and only if You agree to indemnify,
290
+ defend, and hold each Contributor harmless for any liability
291
+ incurred by, or claims asserted against, such Contributor by reason
292
+ of your accepting any such warranty or additional liability.
293
+
294
+ END OF TERMS AND CONDITIONS
295
+
296
+ APPENDIX: How to apply the Apache License to your work.
297
+
298
+ To apply the Apache License to your work, attach the following
299
+ boilerplate notice, with the fields enclosed by brackets "[]"
300
+ replaced with your own identifying information. (Don't include
301
+ the brackets!) The text should be enclosed in the appropriate
302
+ comment syntax for the file format. We also recommend that a
303
+ file or class name and description of purpose be included on the
304
+ same "printed page" as the copyright notice for easier
305
+ identification within third-party archives.
306
+
307
+ Copyright [yyyy] [name of copyright owner]
308
+
309
+ Licensed under the Apache License, Version 2.0 (the "License");
310
+ you may not use this file except in compliance with the License.
311
+ You may obtain a copy of the License at
312
+
313
+ http://www.apache.org/licenses/LICENSE-2.0
314
+
315
+ Unless required by applicable law or agreed to in writing, software
316
+ distributed under the License is distributed on an "AS IS" BASIS,
317
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
318
+ See the License for the specific language governing permissions and
319
+ limitations under the License.
320
+ ```
@@ -0,0 +1,106 @@
1
+ {
2
+ "version": 1,
3
+ "qualifiedAt": "2026-10-29",
4
+ "component": "camera-bound person appearance continuity",
5
+ "sourceFixture": "../tests/fixtures/actor-appearance-original-g326-v1.json",
6
+ "nativeWire": {
7
+ "passed": true,
8
+ "scope": "native client/service identity continuity on original source JPEGs",
9
+ "fixtureSha256": "a69ac56d80c5815695e33dc55b6a55c0ead22ba85d378696f840fdca0aa8e18d",
10
+ "sourceFrames": 40,
11
+ "nativePersonObservations": 93,
12
+ "beforeReviewedPeople": 3,
13
+ "beforePhysicalHistories": 1,
14
+ "afterReviewedPeople": 3,
15
+ "afterPhysicalHistories": 3,
16
+ "reviewedCallerFrames": 12,
17
+ "reviewedCallerPhysicalHistories": 1,
18
+ "nativeChunkedHttpClient": true,
19
+ "nativeWebsiteManagerModelAdmission": true,
20
+ "committedRetryAfterServiceRestart": true,
21
+ "appearanceModel": {
22
+ "modelId": "person_reid_osnet_0277",
23
+ "sha256": "a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d"
24
+ },
25
+ "residentModels": [
26
+ "person_reid_osnet_0277",
27
+ "rfdetr_medium",
28
+ "rtmpose_m_body7"
29
+ ],
30
+ "ramBudgetBytes": 1610612736,
31
+ "evictions": 0,
32
+ "phoneOrTheftAccuracyQualified": false
33
+ },
34
+ "nativeParity": [
35
+ {
36
+ "passed": true,
37
+ "scope": "native person appearance parity on original source pixels",
38
+ "sourceFrames": 40,
39
+ "nativePersonInferences": 93,
40
+ "modelId": "person_reid_osnet_0277",
41
+ "modelSha256": "a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d",
42
+ "threads": 1,
43
+ "maximumNormalizedAbsDifference": 0,
44
+ "fixtureSha256": "a69ac56d80c5815695e33dc55b6a55c0ead22ba85d378696f840fdca0aa8e18d",
45
+ "phoneOrTheftAccuracyQualified": false
46
+ },
47
+ {
48
+ "passed": true,
49
+ "scope": "native person appearance parity on original source pixels",
50
+ "sourceFrames": 40,
51
+ "nativePersonInferences": 93,
52
+ "modelId": "person_reid_osnet_0277",
53
+ "modelSha256": "a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d",
54
+ "threads": 4,
55
+ "maximumNormalizedAbsDifference": 0,
56
+ "fixtureSha256": "a69ac56d80c5815695e33dc55b6a55c0ead22ba85d378696f840fdca0aa8e18d",
57
+ "phoneOrTheftAccuracyQualified": false
58
+ }
59
+ ],
60
+ "export": {
61
+ "modelId": "person_reid_osnet_0277",
62
+ "sha256": "a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d",
63
+ "bytes": 8615662,
64
+ "preprocessing": "osnet_bgr_linear_128x256_raw_fp32_l2_v1",
65
+ "sourceManifest": "https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/person-reidentification-retail-0277/model.yml",
66
+ "sources": [
67
+ {
68
+ "file": "FP32/person-reidentification-retail-0277.xml",
69
+ "source": "https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml",
70
+ "bytes": 451948,
71
+ "sha384": "8b9bd45ee44c67f08b88c82c33cff1bb0f9e7e687c52741461577badbdb7cde146e49fffedb1f813230cd47420af3470",
72
+ "sha256": "5adcc4ff114737479ee16c1a7f525a7e8e1487d86c7ee7a1b50fcd68ee71f596"
73
+ },
74
+ {
75
+ "file": "FP32/person-reidentification-retail-0277.bin",
76
+ "source": "https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.bin",
77
+ "bytes": 8357492,
78
+ "sha384": "adf16b7292f3c3858bd642eed8e471072499872592e242ca2be75fd50100179f72a875b05c1907f56d3d970d751dcba0",
79
+ "sha256": "1968d1f91878813b632441c65c9d9147010d225828ae6acdbda364a2e3337315"
80
+ }
81
+ ],
82
+ "exporterVersions": {
83
+ "openvino2onnx": "1.1.0",
84
+ "openvino": "2026.4.1",
85
+ "onnx": "1.17.0",
86
+ "numpy": "2.1.3"
87
+ },
88
+ "pythonHashSeed": 0,
89
+ "opset": 17,
90
+ "optimizationPasses": false,
91
+ "reproducedExports": 2,
92
+ "license": {
93
+ "spdx": "Apache-2.0",
94
+ "source": "https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE",
95
+ "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
96
+ "copyright": "Copyright (c) 2023-2024 Intel Corporation"
97
+ },
98
+ "modifications": "FP32 OpenVINO IR converted to ONNX opset 17; trained weights unchanged",
99
+ "phoneOrTheftAccuracyQualified": false
100
+ },
101
+ "scopeLimits": [
102
+ "Reviewed continuity controls cover three different people and twelve frames of one caller.",
103
+ "No phone or theft accuracy qualification.",
104
+ "No field deployment attested by this component qualification."
105
+ ]
106
+ }
@@ -0,0 +1,52 @@
1
+ # Native person appearance qualification
2
+
3
+ This helper prevents an uncertain motion association from inheriting earlier
4
+ event history. It produces a 256-value whole-body descriptor for every detected
5
+ person from the original JPEG. It owns no phone-use or theft field.
6
+
7
+ The immutable CPU artifact is Intel person-reidentification-retail-0277, converted
8
+ from its official FP32 IR with unchanged trained weights. Its native input is BGR,
9
+ raw 0–255, NCHW float32, 128 × 256; descriptors are L2-normalized. The export is
10
+ pinned in actor_identity.py and ActorAppearance.ts.
11
+
12
+ ## Reproduce
13
+
14
+ Install requirements-appearance-export.txt in a dedicated environment. Download
15
+ the two FP32 files listed in the official model manifest into a source directory,
16
+ preserving their FP32/ paths. export_actor_appearance.py checks their official
17
+ SHA-384 values, checks dependency versions, exports twice with PYTHONHASHSEED=0,
18
+ requires the canonical ONNX SHA-256, and writes an exact Apache-2.0 license plus
19
+ the source/export receipt alongside the artifact. Run with the detector package
20
+ on PYTHONPATH:
21
+
22
+ ```sh
23
+ python bench/export_actor_appearance.py --source-dir "$SOURCE_DIR" --output "$ARTIFACT"
24
+ python bench/qualify_actor_appearance.py --model "$ARTIFACT" --original-frames "$ORIGINAL_JPEGS" --threads 1 --result cpu1.json
25
+ python bench/qualify_actor_appearance.py --model "$ARTIFACT" --original-frames "$ORIGINAL_JPEGS" --threads 4 --result cpu4.json
26
+ python bench/qualify_actor_appearance_wire.py --detector "$DETECTOR" --pose "$POSE" --appearance "$ARTIFACT" --original-frames "$ORIGINAL_JPEGS" --result-dir native-wire
27
+ ```
28
+
29
+ The wire qualification also requires Node and the SDK's installed TypeScript
30
+ development dependency, with edge-core built. It loads the production native
31
+ model registry, uses the actual chunked HTTP client and original source pixels,
32
+ checks the website manager's actual model-admission gate, checks native person
33
+ rectangles against the reviewed controls, restarts the
34
+ tracking journal/server midway, and checks an exact committed-frame retry.
35
+
36
+ ## Evidence and limits
37
+
38
+ The committed original fixture contains 40 original frames and 93 native person
39
+ descriptors. The canonical ONNX and official FP32 IR differ by at most
40
+ 2.81e-6 after normalization. Production CPU1 and CPU4 inference match the
41
+ fixture exactly. On the three manually reviewed different people, the motion-only
42
+ baseline assigns one history and the appearance path assigns three. Twelve
43
+ manually reviewed caller frames keep one physical history across restart.
44
+
45
+ These controls qualify this identity component. They do not qualify theft or
46
+ phone recognition, all identities in a venue, or a field rollout. Profiles select
47
+ actor_appearance explicitly with inputModelId bound to actor_detection. Existing
48
+ profiles keep their captured policies. Native helpers use the shared model
49
+ residency ceiling and load lazily when selected.
50
+
51
+ Source: [official model manifest](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/person-reidentification-retail-0277/model.yml).
52
+ Model license: [Apache-2.0](https://github.com/openvinotoolkit/open_model_zoo/blob/master/LICENSE).
@@ -0,0 +1,134 @@
1
+ """Reproduce the immutable native OSNet export from checksum-verified vendor IR."""
2
+
3
+ import argparse
4
+ import hashlib
5
+ from importlib.metadata import version
6
+ import json
7
+ import os
8
+ from pathlib import Path
9
+ import subprocess
10
+ import sys
11
+ import tempfile
12
+ import urllib.request
13
+
14
+ from trillboards_detector.actor_identity import MODEL_ID, MODEL_SHA256, PREPROCESSING
15
+
16
+ MODEL = "person-reidentification-retail-0277"
17
+ SOURCE_BASE = (
18
+ "https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1/"
19
+ + MODEL
20
+ + "/"
21
+ )
22
+ MANIFEST = (
23
+ "https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/"
24
+ + MODEL
25
+ + "/model.yml"
26
+ )
27
+ LICENSE = "https://raw.githubusercontent.com/openvinotoolkit/open_model_zoo/master/LICENSE"
28
+ LICENSE_SHA256 = "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4"
29
+ SOURCES = {
30
+ "FP32/"
31
+ + MODEL
32
+ + ".xml": (
33
+ 451948,
34
+ "8b9bd45ee44c67f08b88c82c33cff1bb0f9e7e687c52741461577badbdb7cde146e49fffedb1f813230cd47420af3470",
35
+ ),
36
+ "FP32/"
37
+ + MODEL
38
+ + ".bin": (
39
+ 8357492,
40
+ "adf16b7292f3c3858bd642eed8e471072499872592e242ca2be75fd50100179f72a875b05c1907f56d3d970d751dcba0",
41
+ ),
42
+ }
43
+ VERSIONS = {"openvino2onnx": "1.1.0", "openvino": "2026.4.1", "onnx": "1.17.0", "numpy": "2.1.3"}
44
+
45
+
46
+ def main():
47
+ parser = argparse.ArgumentParser()
48
+ parser.add_argument("--source-dir", required=True)
49
+ parser.add_argument("--output", required=True)
50
+ args = parser.parse_args()
51
+ actual_versions = {name: version(name) for name in VERSIONS}
52
+ if actual_versions != VERSIONS:
53
+ raise ValueError("Export environment differs from the reproducible native recipe")
54
+ source = Path(args.source_dir).resolve()
55
+ output = Path(args.output).resolve()
56
+ output.parent.mkdir(parents=True, exist_ok=True)
57
+ receipts = []
58
+ for name, (size, checksum) in SOURCES.items():
59
+ raw = (source / name).read_bytes()
60
+ if len(raw) != size or hashlib.sha384(raw).hexdigest() != checksum:
61
+ raise ValueError(
62
+ "Vendor FP32 source differs from the official immutable checksum: " + name
63
+ )
64
+ receipts.append(
65
+ {
66
+ "file": name,
67
+ "source": SOURCE_BASE + name,
68
+ "bytes": size,
69
+ "sha384": checksum,
70
+ "sha256": hashlib.sha256(raw).hexdigest(),
71
+ }
72
+ )
73
+ with urllib.request.urlopen(LICENSE, timeout=30) as response:
74
+ license_bytes = response.read(32769)
75
+ if hashlib.sha256(license_bytes).hexdigest() != LICENSE_SHA256:
76
+ raise ValueError("Official Apache-2.0 license changed")
77
+ if output.exists() and hashlib.sha256(output.read_bytes()).hexdigest() != MODEL_SHA256:
78
+ raise ValueError("Refusing to overwrite an artifact with different native bytes")
79
+ with tempfile.TemporaryDirectory(prefix="person-appearance-export-", dir=output.parent) as td:
80
+ exports = []
81
+ for name in ("first.onnx", "second.onnx"):
82
+ target = Path(td) / name
83
+ subprocess.run(
84
+ [
85
+ str(Path(sys.executable).with_name("openvino2onnx")),
86
+ str(source / "FP32" / (MODEL + ".xml")),
87
+ str(target),
88
+ "-v17",
89
+ "-n",
90
+ "-vv",
91
+ "WARNING",
92
+ ],
93
+ check=True,
94
+ timeout=180,
95
+ env={**os.environ, "PYTHONHASHSEED": "0"},
96
+ )
97
+ raw = target.read_bytes()
98
+ if hashlib.sha256(raw).hexdigest() != MODEL_SHA256:
99
+ raise ValueError("Native export differs from the qualified immutable artifact")
100
+ exports.append(raw)
101
+ if exports[0] != exports[1]:
102
+ raise ValueError("Repeated native export is not reproducible")
103
+ if not output.exists():
104
+ target = Path(td) / "final.onnx"
105
+ target.write_bytes(exports[0])
106
+ target.replace(output)
107
+ output.with_name(output.name + ".LICENSE").write_bytes(license_bytes)
108
+ receipt = {
109
+ "modelId": MODEL_ID,
110
+ "sha256": MODEL_SHA256,
111
+ "bytes": len(exports[0]),
112
+ "preprocessing": PREPROCESSING,
113
+ "sourceManifest": MANIFEST,
114
+ "sources": receipts,
115
+ "exporterVersions": actual_versions,
116
+ "pythonHashSeed": 0,
117
+ "opset": 17,
118
+ "optimizationPasses": False,
119
+ "reproducedExports": 2,
120
+ "license": {
121
+ "spdx": "Apache-2.0",
122
+ "source": LICENSE,
123
+ "sha256": LICENSE_SHA256,
124
+ "copyright": "Copyright (c) 2023-2024 Intel Corporation",
125
+ },
126
+ "modifications": "FP32 OpenVINO IR converted to ONNX opset 17; trained weights unchanged",
127
+ "phoneOrTheftAccuracyQualified": False,
128
+ }
129
+ output.with_name(output.name + ".receipt.json").write_text(json.dumps(receipt, indent=2) + "\n")
130
+ print(json.dumps(receipt))
131
+
132
+
133
+ if __name__ == "__main__":
134
+ main()
@@ -0,0 +1,77 @@
1
+ """Check shipped appearance inference against original native vendor outputs."""
2
+
3
+ import argparse
4
+ import hashlib
5
+ import json
6
+ from pathlib import Path
7
+
8
+ import numpy as np
9
+ from trillboards_detector.appearance import PersonAppearanceEstimator
10
+ from trillboards_detector.actor_identity import MODEL_ID, MODEL_SHA256, PREPROCESSING
11
+
12
+
13
+ def main():
14
+ parser = argparse.ArgumentParser()
15
+ parser.add_argument("--model", required=True)
16
+ parser.add_argument("--original-frames", required=True)
17
+ parser.add_argument("--threads", type=int, choices=(1, 4), default=4)
18
+ parser.add_argument("--result")
19
+ args = parser.parse_args()
20
+ fixture_path = (
21
+ Path(__file__).resolve().parents[1]
22
+ / "tests/fixtures/actor-appearance-original-g326-v1.json"
23
+ )
24
+ fixture = json.loads(fixture_path.read_text())
25
+ estimator = PersonAppearanceEstimator(
26
+ args.model, intra_op_threads=args.threads, accelerator="cpu"
27
+ )
28
+ maximum = 0.0
29
+ inferences = 0
30
+ for frame in fixture["frames"]:
31
+ raw = (Path(args.original_frames) / (str(frame["sourceFrame"]) + ".jpg")).read_bytes()
32
+ if hashlib.sha256(raw).hexdigest() != frame["imageSha256"]:
33
+ raise ValueError("Original qualification frame changed")
34
+ expected = frame["appearance"]["descriptors"]
35
+ boxes = []
36
+ for point in expected:
37
+ d = frame["detections"][point["detectionIndex"]]
38
+ boxes.append([d["x"], d["y"], d["x"] + d["width"], d["y"] + d["height"]])
39
+ result = estimator.estimate(raw, boxes)
40
+ if (
41
+ result["modelId"] != MODEL_ID
42
+ or result["modelSha256"] != MODEL_SHA256
43
+ or result["preprocessing"] != PREPROCESSING
44
+ or result["imageSha256"] != frame["imageSha256"]
45
+ or len(result["descriptors"]) != len(expected)
46
+ ):
47
+ raise ValueError("Native appearance model or original person ownership changed")
48
+ for actual, reference in zip(result["descriptors"], expected):
49
+ if (
50
+ actual["bounds"] != reference["bounds"]
51
+ or actual["inputSha256"] != reference["inputSha256"]
52
+ ):
53
+ raise ValueError("Native appearance input pixels changed")
54
+ error = float(np.max(np.abs(np.asarray(actual["embedding"]) - reference["embedding"])))
55
+ maximum = max(maximum, error)
56
+ if error > 3e-5:
57
+ raise ValueError("Shipped appearance output differs from native vendor reference")
58
+ inferences += 1
59
+ report = {
60
+ "passed": True,
61
+ "scope": "native person appearance parity on original source pixels",
62
+ "sourceFrames": len(fixture["frames"]),
63
+ "nativePersonInferences": inferences,
64
+ "modelId": MODEL_ID,
65
+ "modelSha256": MODEL_SHA256,
66
+ "threads": args.threads,
67
+ "maximumNormalizedAbsDifference": maximum,
68
+ "fixtureSha256": hashlib.sha256(fixture_path.read_bytes()).hexdigest(),
69
+ "phoneOrTheftAccuracyQualified": False,
70
+ }
71
+ if args.result:
72
+ Path(args.result).write_text(json.dumps(report, indent=2) + "\n")
73
+ print(json.dumps(report))
74
+
75
+
76
+ if __name__ == "__main__":
77
+ main()
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ /* Native qualification uses the shipped client over its real chunked HTTP transport. */
3
+ 'use strict';
4
+ const fs=require('node:fs');
5
+ const path=require('node:path');
6
+ const crypto=require('node:crypto');
7
+ const ts=require('typescript');
8
+ require.extensions['.ts']=(module,filename)=>{
9
+ const result=ts.transpileModule(fs.readFileSync(filename,'utf8'),{
10
+ fileName:filename,compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES2022,
11
+ esModuleInterop:true}});
12
+ module._compile(result.outputText,filename);
13
+ };
14
+ const {ActorPerceptionClient}=require(path.resolve(__dirname,'../../../src/ActorPerception.ts'));
15
+ async function main(){
16
+ const [baseUrl,fixturePath,framesPath,policyPath,outputPath,begin,end]=process.argv.slice(2);
17
+ const raw=fs.readFileSync(fixturePath),fixture=JSON.parse(raw);
18
+ const policy=JSON.parse(fs.readFileSync(policyPath,'utf8'));
19
+ const {assertSelectedModelsPrepared}=require(path.resolve(__dirname,'../../../retained/manager.cjs'));
20
+ assertSelectedModelsPrepared([policy.detector,policy.pose,policy.appearance].filter(Boolean)
21
+ .map(pin=>({...pin,format:'onnx'})),policy,true);
22
+ const client=new ActorPerceptionClient(policy,{baseUrl,timeoutMs:60000});
23
+ const contextSha256=crypto.createHash('sha256').update(raw).digest('hex');
24
+ const frames=[];
25
+ for(const frame of fixture.frames.slice(Number(begin),Number(end))){
26
+ const jpeg=fs.readFileSync(path.join(framesPath,String(frame.sourceFrame)+'.jpg'));
27
+ if(crypto.createHash('sha256').update(jpeg).digest('hex')!==frame.imageSha256)
28
+ throw Error('Original source JPEG changed');
29
+ const input={frameId:frame.request.frameId,capturedAtMs:frame.request.capturedAtMs,jpeg,contextSha256};
30
+ const actual=await client.perceive(input);
31
+ if(actual.result.detections.length!==frame.detections.length)
32
+ throw Error('Native detector count differs from original reviewed controls');
33
+ actual.result.detections.forEach((d,i)=>{
34
+ const reference=frame.detections[i];
35
+ if(d.label!==reference.label||Math.abs(d.confidence-reference.confidence)>1e-5
36
+ ||Object.entries(d.box).some(([key,value])=>Math.abs(value-reference[key])>1e-4))
37
+ throw Error('Native person rectangle differs from the reviewed source control');
38
+ });
39
+ frames.push({sourceFrame:frame.sourceFrame,...actual});
40
+ fs.writeFileSync(outputPath,JSON.stringify({frames},null,2)+'\n');
41
+ }
42
+ const frame=fixture.frames[Number(end)-1],last=frames.at(-1);
43
+ const jpeg=fs.readFileSync(path.join(framesPath,String(frame.sourceFrame)+'.jpg'));
44
+ const retry=await client.perceive({frameId:frame.request.frameId,
45
+ capturedAtMs:frame.request.capturedAtMs,jpeg,contextSha256});
46
+ if(JSON.stringify(retry.result.tracking)!==JSON.stringify(last.result.tracking))
47
+ throw Error('Committed frame retry changed physical actor history');
48
+ console.log(JSON.stringify({frames:frames.length,nativeClientProofsVerified:true}));
49
+ }
50
+ main().catch(error=>{console.error(error);process.exitCode=1;});