@trillboards/edge-sdk 0.2.196 → 0.2.200
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.
- package/deploy/detector/pyproject.toml +1 -1
- package/deploy/detector/tests/test_colors_v2.py +79 -0
- package/deploy/detector/tests/test_detection_colors_wire.py +25 -0
- package/deploy/detector/tests/test_held_phone_customer_packaging.py +102 -0
- package/deploy/detector/trillboards_detector/_version.py +2 -2
- package/deploy/detector/trillboards_detector/colors.py +30 -11
- package/deploy/detector/trillboards_detector/server.py +1 -1
- package/deploy/litertlm/test_attention_token_budget.py +57 -0
- package/deploy/litertlm/trillboards_litertlm_shim.py +96 -1
- package/deploy/macos/build-macos-pkg.sh +14 -2
- package/deploy/windows/build-windows.ps1 +12 -2
- package/deploy/windows/ci/test-published-install.ps1 +167 -8
- package/deploy/windows/setup-detector.ps1 +4 -1
- package/dist/DetectionColors.d.ts +11 -4
- package/dist/DetectionColors.d.ts.map +1 -1
- package/dist/DetectionColors.js +5 -2
- package/dist/DetectionColors.js.map +1 -1
- package/dist/DetectorFields.d.ts +138 -4
- package/dist/DetectorFields.d.ts.map +1 -1
- package/dist/DetectorFields.js +101 -11
- package/dist/DetectorFields.js.map +1 -1
- package/dist/EdgeAgent.js +1 -1
- package/dist/LiteRtVlmProvider.d.ts.map +1 -1
- package/dist/LiteRtVlmProvider.js +10 -1
- package/dist/LiteRtVlmProvider.js.map +1 -1
- package/dist/PhoneEmbeddingClassifier.d.ts +28 -0
- package/dist/PhoneEmbeddingClassifier.d.ts.map +1 -0
- package/dist/PhoneEmbeddingClassifier.js +40 -0
- package/dist/PhoneEmbeddingClassifier.js.map +1 -0
- package/dist/RetainedFieldContract.d.ts +9 -1
- package/dist/RetainedFieldContract.d.ts.map +1 -1
- package/dist/RetainedFieldContract.js +19 -3
- package/dist/RetainedFieldContract.js.map +1 -1
- package/dist/ScopedVlmReview.d.ts +6 -2
- package/dist/ScopedVlmReview.d.ts.map +1 -1
- package/dist/ScopedVlmReview.js +55 -5
- package/dist/ScopedVlmReview.js.map +1 -1
- package/dist/SensingProfileClient.d.ts +6 -0
- package/dist/SensingProfileClient.d.ts.map +1 -1
- package/dist/SensingProfileClient.js +7 -0
- package/dist/SensingProfileClient.js.map +1 -1
- package/dist/diagnose.d.ts +1 -1
- package/dist/diagnose.js +1 -1
- package/dist/localSensing.d.ts +5 -2
- package/dist/localSensing.d.ts.map +1 -1
- package/dist/localSensing.js +56 -8
- package/dist/localSensing.js.map +1 -1
- package/package.json +3 -3
- package/retained/ProfileAuthorityClient.cjs +1 -1
- package/retained/RetainedCaptureClient.cjs +2 -1
- package/retained/WebsiteAdmissionCaptureClient.cjs +478 -0
- package/retained/WebsiteAdmissionState.cjs +75 -0
- package/retained/__tests__/actor-perception.test.cjs +1 -1
- package/retained/__tests__/actor-window.test.cjs +1 -1
- package/retained/__tests__/archive-lifecycle.test.cjs +1 -1
- package/retained/__tests__/runtime.test.cjs +30 -2
- package/retained/__tests__/website-admission-realtime.test.cjs +503 -0
- package/retained/__tests__/website-admission.test.cjs +806 -0
- package/retained/manager.cjs +4 -1
- package/retained/pilot-profile-client.cjs +2 -1
|
@@ -142,15 +142,162 @@ function Wait-DetectorAnswer {
|
|
|
142
142
|
throw 'The installed detector did not answer after restart'
|
|
143
143
|
}
|
|
144
144
|
function Assert-ImageInference {
|
|
145
|
+
param([string]$InferenceModel = 'gemma-4-E2B-it.litertlm', [string]$ExpectedModelSha256 = '', [System.Collections.IDictionary]$Evidence = $null)
|
|
145
146
|
$image = [Convert]::ToBase64String([IO.File]::ReadAllBytes($PersonFrame))
|
|
146
|
-
$body = @{ model =
|
|
147
|
+
$body = @{ model = $InferenceModel; max_completion_tokens = 256; temperature = 0;
|
|
147
148
|
messages = @(@{ role = 'user'; content = @(@{ type = 'text'; text = 'Look at the image. Is there a person visible? Answer YES or NO.' },
|
|
148
149
|
@{ type = 'image_url'; image_url = @{ url = ('data:image/jpeg;base64,' + $image) } }) }) } | ConvertTo-Json -Depth 10
|
|
149
|
-
$
|
|
150
|
+
$request = @{ Uri = 'http://127.0.0.1:9379/v1/chat/completions'; Method = 'Post'; ContentType = 'application/json'; Body = $body; TimeoutSec = 240 }
|
|
151
|
+
if ($ExpectedModelSha256) {
|
|
152
|
+
# Same endpoint and selected delegate as the default Windows customer client.
|
|
153
|
+
$request.Uri = 'http://localhost:9379/v1/chat/completions'
|
|
154
|
+
$request.Headers = @{ 'X-Trillboards-Model-Sha256' = $ExpectedModelSha256 }
|
|
155
|
+
}
|
|
156
|
+
if ($null -ne $Evidence) {
|
|
157
|
+
$Evidence.request = [ordered]@{ uri = $request.Uri; model = $InferenceModel; modelSha256 = $ExpectedModelSha256;
|
|
158
|
+
personImageSha256 = (Get-FileHash -LiteralPath $PersonFrame -Algorithm SHA256).Hash.ToLowerInvariant();
|
|
159
|
+
maxCompletionTokens = 256; temperature = 0; timeoutSeconds = 240 }
|
|
160
|
+
}
|
|
161
|
+
$answer = Invoke-RestMethod @request
|
|
162
|
+
if ($null -ne $Evidence) { $Evidence.response = $answer }
|
|
163
|
+
if ($ExpectedModelSha256) { Assert-QualificationRuntimeProof $answer $InferenceModel $ExpectedModelSha256 }
|
|
150
164
|
if (@($answer.choices).Count -lt 1 -or [string]$answer.choices[0].message.content -notmatch '(?i)\byes\b') {
|
|
151
165
|
throw 'The installed model did not confirm the person in the committed image fixture'
|
|
152
166
|
}
|
|
153
167
|
}
|
|
168
|
+
function Get-QualificationClockSeconds { [Diagnostics.Stopwatch]::GetTimestamp() / [double][Diagnostics.Stopwatch]::Frequency }
|
|
169
|
+
function New-QualificationSetupBarrier {
|
|
170
|
+
$sid = [Security.Principal.WindowsIdentity]::GetCurrent().User.Value
|
|
171
|
+
New-Object System.Threading.Mutex($false, ('Global\TrillboardsLiteRtLmSetup-' + $sid))
|
|
172
|
+
}
|
|
173
|
+
function Get-QualificationModelConfigPath { Join-Path $env:USERPROFILE '.litert-lm\config.json' }
|
|
174
|
+
function Invoke-QualificationModelInspection {
|
|
175
|
+
# Reuse installed ownership validation, including SID, uv runtime and foreign listeners.
|
|
176
|
+
& (Join-Path $installDir 'bin\stop-local-ai.ps1') -Service Model -Inspect
|
|
177
|
+
}
|
|
178
|
+
function Get-QualificationModelSnapshot {
|
|
179
|
+
$snapshot = [ordered]@{ ready = $false; atUtc = [DateTimeOffset]::UtcNow.ToString('o'); reason = 'config-unverified' }
|
|
180
|
+
$path = Get-QualificationModelConfigPath
|
|
181
|
+
$snapshot.configPath = $path
|
|
182
|
+
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { return $snapshot }
|
|
183
|
+
$snapshot.configSha256 = (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
184
|
+
$snapshot.configText = [IO.File]::ReadAllText($path)
|
|
185
|
+
try { $snapshot.config = $snapshot.configText | ConvertFrom-Json } catch {
|
|
186
|
+
$snapshot.reason = 'config-invalid'; $snapshot.configError = $_.Exception.Message; return $snapshot
|
|
187
|
+
}
|
|
188
|
+
if ((Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash -ine $snapshot.configSha256) {
|
|
189
|
+
$snapshot.reason = 'config-changing'; return $snapshot
|
|
190
|
+
}
|
|
191
|
+
$models = $snapshot.config.PSObject.Properties['models']
|
|
192
|
+
if ($null -eq $models) { return $snapshot }
|
|
193
|
+
$model = $models.Value.PSObject.Properties['gemma-4-E2B-it.litertlm']
|
|
194
|
+
if ($null -eq $model) { return $snapshot }
|
|
195
|
+
$backend = $model.Value.PSObject.Properties['backend']
|
|
196
|
+
if ($null -eq $backend -or [string]$backend.Value -notin @('cpu','gpu','npu')) { return $snapshot }
|
|
197
|
+
$snapshot.backend = [string]$backend.Value
|
|
198
|
+
# LiteRtVlmProvider.ts:450-458,607-636: auto uses verified Windows CPU; otherwise GPU.
|
|
199
|
+
$snapshot.inferenceModel = 'gemma-4-E2B-it.litertlm,' + $(if ($snapshot.backend -eq 'cpu') { 'cpu' } else { 'gpu' })
|
|
200
|
+
$snapshot.ownership = Invoke-QualificationModelInspection
|
|
201
|
+
if (-not $snapshot.ownership.TaskPresent -or -not $snapshot.ownership.Enabled -or -not $snapshot.ownership.Running -or
|
|
202
|
+
$snapshot.ownership.Port -ne 9379 -or $snapshot.ownership.ListenerCount -lt 1) {
|
|
203
|
+
$snapshot.reason = 'owned-service-not-listening'; return $snapshot
|
|
204
|
+
}
|
|
205
|
+
$listeners = @(Get-NetTCPConnection -LocalPort 9379 -State Listen -ErrorAction Stop | Select-Object -ExpandProperty OwningProcess -Unique)
|
|
206
|
+
if ($listeners.Count -ne 1) { $snapshot.reason = 'ambiguous-producer'; return $snapshot }
|
|
207
|
+
$producer = @(Get-CimInstance -ClassName Win32_Process -Filter ('ProcessId=' + $listeners[0]) -OperationTimeoutSec 5 -ErrorAction Stop)
|
|
208
|
+
if ($producer.Count -ne 1 -or -not $producer[0].CreationDate -or -not $producer[0].ExecutablePath -or -not $producer[0].CommandLine) {
|
|
209
|
+
$snapshot.reason = 'producer-identity-unavailable'; return $snapshot
|
|
210
|
+
}
|
|
211
|
+
$snapshot.producer = [ordered]@{ processId = [int]$producer[0].ProcessId; creationDate = [string]$producer[0].CreationDate;
|
|
212
|
+
executablePath = [string]$producer[0].ExecutablePath; commandLine = [string]$producer[0].CommandLine }
|
|
213
|
+
# Recheck authority after reading the producer; never accept a newly foreign listener.
|
|
214
|
+
$null = Invoke-QualificationModelInspection
|
|
215
|
+
$snapshot.ready = $true; $snapshot.reason = 'owned-verified-configuration'
|
|
216
|
+
return $snapshot
|
|
217
|
+
}
|
|
218
|
+
function Assert-QualificationModelGeneration($Before, $After) {
|
|
219
|
+
if (-not $Before.ready -or -not $After.ready -or $Before.configSha256 -cne $After.configSha256 -or
|
|
220
|
+
$Before.backend -cne $After.backend -or $Before.inferenceModel -cne $After.inferenceModel -or
|
|
221
|
+
$Before.producer.processId -ne $After.producer.processId -or $Before.producer.creationDate -cne $After.producer.creationDate -or
|
|
222
|
+
$Before.producer.executablePath -cne $After.producer.executablePath -or $Before.producer.commandLine -cne $After.producer.commandLine) {
|
|
223
|
+
throw 'The model configuration or producer generation changed during restart qualification'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function Wait-QualificationModelReady($Evidence) {
|
|
227
|
+
$started = Get-QualificationClockSeconds
|
|
228
|
+
$barrier = New-QualificationSetupBarrier
|
|
229
|
+
try {
|
|
230
|
+
while (((Get-QualificationClockSeconds) - $started) -lt 120) {
|
|
231
|
+
$held = $false
|
|
232
|
+
try {
|
|
233
|
+
try { $held = $barrier.WaitOne(0) } catch [Threading.AbandonedMutexException] { $held = $true; $Evidence.abandonedSetupOwner = $true }
|
|
234
|
+
if ($held) {
|
|
235
|
+
$Evidence.setupBarrierAcquired = $true
|
|
236
|
+
$snapshot = Get-QualificationModelSnapshot
|
|
237
|
+
$Evidence.lastReadinessSnapshot = $snapshot
|
|
238
|
+
if ($snapshot.ready -and ((Get-QualificationClockSeconds) - $started) -lt 120) { return $snapshot }
|
|
239
|
+
}
|
|
240
|
+
} finally { if ($held) { $barrier.ReleaseMutex() } }
|
|
241
|
+
$remaining = 120 - ((Get-QualificationClockSeconds) - $started)
|
|
242
|
+
if ($remaining -gt 0) { Start-Sleep -Milliseconds ([int][Math]::Min(2000, [Math]::Ceiling($remaining * 1000))) }
|
|
243
|
+
}
|
|
244
|
+
throw 'The owned verified model configuration did not become ready within the existing 120-second deadline'
|
|
245
|
+
} finally { $Evidence.readinessSeconds = (Get-QualificationClockSeconds) - $started; $barrier.Dispose() }
|
|
246
|
+
}
|
|
247
|
+
function Test-QualificationSetupIdle {
|
|
248
|
+
$barrier = New-QualificationSetupBarrier
|
|
249
|
+
$held = $false
|
|
250
|
+
try {
|
|
251
|
+
try { $held = $barrier.WaitOne(0) } catch [Threading.AbandonedMutexException] { $held = $true }
|
|
252
|
+
return $held
|
|
253
|
+
} finally { if ($held) { $barrier.ReleaseMutex() }; $barrier.Dispose() }
|
|
254
|
+
}
|
|
255
|
+
function Assert-QualificationRuntimeProof($Answer, [string]$InferenceModel, [string]$Sha256) {
|
|
256
|
+
$property = $Answer.PSObject.Properties['runtimeModel']
|
|
257
|
+
if ($null -eq $property -or $null -eq $property.Value) { throw 'The person response lacks native runtime model proof' }
|
|
258
|
+
$proof = $property.Value
|
|
259
|
+
if ((@($proof.PSObject.Properties.Name | Sort-Object) -join ',') -cne 'format,runtimeModelId,sha256,version' -or
|
|
260
|
+
$proof.version -ne 1 -or $proof.format -cne 'litert-lm' -or $proof.sha256 -cne $Sha256 -or $proof.runtimeModelId -cne $InferenceModel) {
|
|
261
|
+
throw 'The person response did not execute the selected artifact/backend'
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function Assert-RestartImageInference([string]$ServiceName) {
|
|
265
|
+
$evidence = [ordered]@{ service = $ServiceName; passed = $false; phase = 'setup-completion'; setupBarrierAcquired = $false;
|
|
266
|
+
startedAtUtc = [DateTimeOffset]::UtcNow.ToString('o'); readinessDeadlineSeconds = 120; personTimeoutSeconds = 240;
|
|
267
|
+
backendStandardError = @{ available = $false; reason = 'The installed Windows hidden model task discards stdout/stderr; see register-litertlm-task.ps1:30-41. Available provisioner logs are retained separately.' } }
|
|
268
|
+
$receipt.serviceRestartChecks += $evidence
|
|
269
|
+
try {
|
|
270
|
+
# Setup completion is a barrier only. The customer client takes no setup lock.
|
|
271
|
+
$ready = Wait-QualificationModelReady $evidence
|
|
272
|
+
$evidence.phase = 'detector-readiness'
|
|
273
|
+
Wait-DetectorAnswer
|
|
274
|
+
Assert-HiddenTask 'TrillboardsLiteRtLm'; Assert-HiddenTask 'TrillboardsDetector'
|
|
275
|
+
$evidence.phase = 'before-person-inference'
|
|
276
|
+
$evidence.setupIdleBeforeInference = Test-QualificationSetupIdle
|
|
277
|
+
if (-not $evidence.setupIdleBeforeInference) { throw 'Model setup became active before acceptance inference' }
|
|
278
|
+
$evidence.beforeInference = Get-QualificationModelSnapshot
|
|
279
|
+
Assert-QualificationModelGeneration $ready $evidence.beforeInference
|
|
280
|
+
$evidence.phase = 'person-inference'
|
|
281
|
+
Assert-ImageInference -InferenceModel $ready.inferenceModel -ExpectedModelSha256 'ab7838cdfc8f77e54d8ca45eadceb20452d9f01e4bfade03e5dce27911b27e42' -Evidence $evidence
|
|
282
|
+
$evidence.phase = 'after-person-inference'
|
|
283
|
+
$evidence.afterInference = Get-QualificationModelSnapshot
|
|
284
|
+
$evidence.setupIdleAfterInference = Test-QualificationSetupIdle
|
|
285
|
+
if (-not $evidence.setupIdleAfterInference) { throw 'Model setup became active during acceptance inference' }
|
|
286
|
+
Assert-QualificationModelGeneration $evidence.beforeInference $evidence.afterInference
|
|
287
|
+
$evidence.passed = $true; $evidence.phase = 'complete'
|
|
288
|
+
} catch {
|
|
289
|
+
$evidence.failure = $_.Exception.Message
|
|
290
|
+
$evidence.failureType = $_.Exception.GetType().FullName
|
|
291
|
+
$evidence.failureId = $_.FullyQualifiedErrorId
|
|
292
|
+
$evidence.failureStack = $_.ScriptStackTrace
|
|
293
|
+
try { $evidence.afterFailure = Get-QualificationModelSnapshot } catch { $evidence.afterFailureError = $_.Exception.Message }
|
|
294
|
+
throw
|
|
295
|
+
} finally {
|
|
296
|
+
$evidence.completedAtUtc = [DateTimeOffset]::UtcNow.ToString('o')
|
|
297
|
+
$evidence | ConvertTo-Json -Depth 16 | Set-Content -LiteralPath (Join-Path $root ('restart-' + $ServiceName + '.json'))
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
154
301
|
try {
|
|
155
302
|
if ([bool]$CustomerPackagePath -ne [bool]$ManifestPath) { throw 'Candidate package and manifest paths must be provided together' }
|
|
156
303
|
$localCandidate = [bool]$CustomerPackagePath
|
|
@@ -220,16 +367,28 @@ try {
|
|
|
220
367
|
Wait-ModelReady; Wait-DetectorAnswer
|
|
221
368
|
$receipt.phase = 'repeat-install-inference'
|
|
222
369
|
Assert-ImageInference
|
|
223
|
-
$receipt.repeatInstallPassed = $true; $receipt.phase = 'service-restart'
|
|
370
|
+
$receipt.repeatInstallPassed = $true; $receipt.phase = 'service-restart'; $receipt.serviceRestartChecks = @()
|
|
371
|
+
$receipt.serviceRestartPreparationChecks = @()
|
|
224
372
|
$powershell = Join-Path $env:WINDIR 'System32\WindowsPowerShell\v1.0\powershell.exe'
|
|
225
373
|
foreach ($service in @(@{ Name = 'Model'; Task = 'TrillboardsLiteRtLm' }, @{ Name = 'Detector'; Task = 'TrillboardsDetector' })) {
|
|
374
|
+
$preStop = [ordered]@{ service = $service.Name; phase = 'before-stop-setup-completion'; passed = $false;
|
|
375
|
+
setupBarrierAcquired = $false; startedAtUtc = [DateTimeOffset]::UtcNow.ToString('o'); readinessDeadlineSeconds = 120 }
|
|
376
|
+
$receipt.serviceRestartPreparationChecks += $preStop
|
|
377
|
+
try {
|
|
378
|
+
# Completion precondition only; the existing waiter releases the mutex before stop/start.
|
|
379
|
+
$preStop.snapshot = Wait-QualificationModelReady $preStop
|
|
380
|
+
$preStop.passed = $true
|
|
381
|
+
} catch {
|
|
382
|
+
$preStop.failure = $_.Exception.Message
|
|
383
|
+
throw
|
|
384
|
+
} finally {
|
|
385
|
+
$preStop.completedAtUtc = [DateTimeOffset]::UtcNow.ToString('o')
|
|
386
|
+
}
|
|
226
387
|
$null = Invoke-QualificationProcess -File $powershell -Arguments @('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File',
|
|
227
388
|
(Join-Path $installDir 'bin\stop-local-ai.ps1'), '-Service', $service.Name) -LogName ('stop-' + $service.Name + '.log') -TimeoutSeconds 90
|
|
228
389
|
Enable-ScheduledTask -TaskName $service.Task -TaskPath '\' -ErrorAction Stop | Out-Null
|
|
229
390
|
Start-ScheduledTask -TaskName $service.Task -TaskPath '\' -ErrorAction Stop
|
|
230
|
-
|
|
231
|
-
Assert-HiddenTask 'TrillboardsLiteRtLm'; Assert-HiddenTask 'TrillboardsDetector'
|
|
232
|
-
Assert-ImageInference
|
|
391
|
+
Assert-RestartImageInference -ServiceName $service.Name
|
|
233
392
|
}
|
|
234
393
|
$receipt.serviceRestartPassed = $true; $receipt.phase = 'uninstall'
|
|
235
394
|
$receipt.uninstallerSha256 = Invoke-InstalledUninstaller -InstallDir $installDir -RunRoot $root -InheritPowerShellModulePath:($PowerShellModuleEnvironment -eq 'Inherited')
|
|
@@ -250,7 +409,7 @@ try {
|
|
|
250
409
|
if (Test-Path -LiteralPath $logDir -PathType Container) { Copy-Item -LiteralPath $logDir -Destination (Join-Path $root 'product-logs') -Recurse -Force }
|
|
251
410
|
} catch { Write-Warning ('Some product logs could not be copied: ' + $_.Exception.Message) }
|
|
252
411
|
$receipt.completedAtUtc = [DateTimeOffset]::UtcNow.ToString('o')
|
|
253
|
-
$receipt | ConvertTo-Json -Depth
|
|
412
|
+
$receipt | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath (Join-Path $root 'qualification.json')
|
|
254
413
|
if ($env:GITHUB_OUTPUT) { ('artifact_path=' + $root) | Out-File -LiteralPath $env:GITHUB_OUTPUT -Append -Encoding utf8 }
|
|
255
|
-
$receipt | ConvertTo-Json -Depth
|
|
414
|
+
$receipt | ConvertTo-Json -Depth 20
|
|
256
415
|
}
|
|
@@ -76,7 +76,10 @@ function Resolve-DetectorSource {
|
|
|
76
76
|
# and a matching package version do not prove the detector can even import.
|
|
77
77
|
function Ensure-DetectorNativeRuntime {
|
|
78
78
|
$required = @('vcruntime140.dll','vcruntime140_1.dll','msvcp140.dll')
|
|
79
|
-
|
|
79
|
+
# The NSIS installer is 32-bit: its System32 view is redirected to SysWOW64.
|
|
80
|
+
# Inspect the native x64 DLLs through Sysnative in that process only.
|
|
81
|
+
$nativeSystemDirectory = if ([Environment]::Is64BitOperatingSystem -and -not [Environment]::Is64BitProcess) { 'Sysnative' } else { 'System32' }
|
|
82
|
+
$missing = @($required | Where-Object { -not (Test-Path -LiteralPath (Join-Path $env:WINDIR ($nativeSystemDirectory + '\' + $_))) })
|
|
80
83
|
if (-not $missing.Count) { return }
|
|
81
84
|
Log 'Installing the missing Microsoft x64 C++ runtime required by the local detector'
|
|
82
85
|
$runtimeDirectory = [IO.Path]::GetFullPath((Join-Path $env:TEMP ('trillboards-detector-vc-' + [Guid]::NewGuid().ToString('N'))))
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* The detector service's `detection_colors` task: the share of each confident
|
|
3
3
|
* person box whose pixels are a requested colour, measured on the original
|
|
4
4
|
* frame with Pillow's 8-bit HSV (deploy/detector/trillboards_detector/colors.py).
|
|
5
|
-
* No model
|
|
6
|
-
*
|
|
5
|
+
* No model, garment classification or decision: the connector applies the
|
|
6
|
+
* declared method to the measured colour share.
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface DetectionColorsV1Request {
|
|
9
9
|
version: 1;
|
|
10
10
|
minScore: number;
|
|
11
11
|
maxBoxes: number;
|
|
@@ -13,8 +13,15 @@ export interface DetectionColorsRequest {
|
|
|
13
13
|
minSaturation: number;
|
|
14
14
|
minValue: number;
|
|
15
15
|
}
|
|
16
|
+
/** Version 2 bounds achromatic and other selected colours without changing v1. */
|
|
17
|
+
export interface DetectionColorsV2Request extends Omit<DetectionColorsV1Request, 'version'> {
|
|
18
|
+
version: 2;
|
|
19
|
+
maxSaturation: number;
|
|
20
|
+
maxValue: number;
|
|
21
|
+
}
|
|
22
|
+
export type DetectionColorsRequest = DetectionColorsV1Request | DetectionColorsV2Request;
|
|
16
23
|
export interface DetectionColorsResult {
|
|
17
|
-
version: 1;
|
|
24
|
+
version: 1 | 2;
|
|
18
25
|
imageSha256: string;
|
|
19
26
|
frameSize: {
|
|
20
27
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetectionColors.d.ts","sourceRoot":"","sources":["../src/DetectionColors.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"DetectionColors.d.ts","sourceRoot":"","sources":["../src/DetectionColors.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;A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AC,MAAM,EACjG,YAAY,EAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,MAAM,CAAA;CAAC,EAAC,UAAU,EAAC,aAAa,CAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAA,UAAU,EAAC,MAAM,CAAA;CAAC,CAAC,GAAE,qBAAqB,CAe5H"}
|
package/dist/DetectionColors.js
CHANGED
|
@@ -12,10 +12,13 @@ const finite = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
|
12
12
|
const byte = (v) => Number.isSafeInteger(v) && v >= 0 && v <= 255;
|
|
13
13
|
function validateDetectionColorsRequest(value) {
|
|
14
14
|
const v = value;
|
|
15
|
-
if (!keys(v, 'hue,maxBoxes,minSaturation,minScore,minValue,version'
|
|
15
|
+
if (!keys(v, v?.version === 2 ? 'hue,maxBoxes,maxSaturation,maxValue,minSaturation,minScore,minValue,version'
|
|
16
|
+
: 'hue,maxBoxes,minSaturation,minScore,minValue,version') || (v.version !== 1 && v.version !== 2)
|
|
16
17
|
|| !finite(v.minScore) || v.minScore <= 0 || v.minScore > 1
|
|
17
18
|
|| !Number.isSafeInteger(v.maxBoxes) || v.maxBoxes < 1 || v.maxBoxes > exports.MAX_COLOR_BOXES
|
|
18
19
|
|| !byte(v.minSaturation) || !byte(v.minValue)
|
|
20
|
+
|| v.version === 2 && (!byte(v.maxSaturation) || v.maxSaturation < v.minSaturation
|
|
21
|
+
|| !byte(v.maxValue) || v.maxValue < v.minValue)
|
|
19
22
|
|| !Array.isArray(v.hue) || v.hue.length < 1 || v.hue.length > 4
|
|
20
23
|
|| v.hue.some(r => !Array.isArray(r) || r.length !== 2 || !byte(r[0]) || !byte(r[1]) || r[0] > r[1]))
|
|
21
24
|
throw Error('Invalid detection colour request');
|
|
@@ -32,7 +35,7 @@ function colorBoxIndices(detections, request) {
|
|
|
32
35
|
function parseDetectionColorsResult(value, request, jpeg, originalSize, detections) {
|
|
33
36
|
validateDetectionColorsRequest(request);
|
|
34
37
|
const v = value;
|
|
35
|
-
if (!keys(v, 'frameSize,imageSha256,people,request,version') || v.version !==
|
|
38
|
+
if (!keys(v, 'frameSize,imageSha256,people,request,version') || v.version !== request.version
|
|
36
39
|
|| v.imageSha256 !== (0, crypto_1.createHash)('sha256').update(jpeg).digest('hex')
|
|
37
40
|
|| !keys(v.frameSize, 'height,width') || v.frameSize.width !== originalSize.width
|
|
38
41
|
|| v.frameSize.height !== originalSize.height || !(0, util_1.isDeepStrictEqual)(v.request, request)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetectionColors.js","sourceRoot":"","sources":["../src/DetectionColors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DetectionColors.js","sourceRoot":"","sources":["../src/DetectionColors.ts"],"names":[],"mappings":";;;AA6BA,wEAaC;AAGD,0CAMC;AAGD,gEAgBC;AAtED,mCAAkC;AAClC,+BAAuC;AAuB1B,QAAA,eAAe,GAAC,EAAE,CAAC;AAChC,MAAM,IAAI,GAAC,CAAC,CAAS,EAAC,IAAW,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,IAAE,OAAO,CAAC,KAAG,QAAQ,IAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAG,IAAI,CAAC;AACxH,MAAM,MAAM,GAAC,CAAC,CAAS,EAAa,EAAE,CAAA,OAAO,CAAC,KAAG,QAAQ,IAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC9E,MAAM,IAAI,GAAC,CAAC,CAAS,EAAC,EAAE,CAAA,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAG,CAAY,IAAE,CAAC,IAAG,CAAY,IAAE,GAAG,CAAC;AAEtF,SAAgB,8BAA8B,CAAC,KAAa;IAC1D,MAAM,CAAC,GAAC,KAA+B,CAAC;IACxC,IAA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AAM,CAAC,KAAK,CAAC;WAC/D,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAC,cAAc,CAAC,IAAE,CAAC,CAAC,SAAS,CAAC,KAAK,KAAG,YAAY,CAAC,KAAK;WACzE,CAAC,CAAC,SAAS,CAAC,MAAM,KAAG,YAAY,CAAC,MAAM,IAAE,CAAC,IAAA,wBAAiB,EAAC,CAAC,CAAC,OAAO,EAAC,OAAO,CAAC;WAC/E,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAAC,MAAM,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACjG,MAAM,QAAQ,GAAC,eAAe,CAAC,UAAU,EAAC,OAAO,CAAC,CAAC;IACnD,IAAG,CAAC,CAAC,MAAM,CAAC,MAAM,KAAG,QAAQ,CAAC,MAAM;QAAC,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAC,CAAC,EAAC,EAAE;QACxB,IAAG,CAAC,IAAI,CAAC,GAAG,EAAC,yBAAyB,CAAC,IAAE,GAAG,CAAC,cAAc,KAAG,QAAQ,CAAC,CAAC,CAAC;eACrE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAE,GAAG,CAAC,QAAQ,GAAC,CAAC,IAAE,GAAG,CAAC,QAAQ,GAAC,CAAC;YAAC,MAAM,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"}
|
package/dist/DetectorFields.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Detection } from './LocalDetectorClient';
|
|
2
|
-
import type
|
|
2
|
+
import { type DetectionColorsRequest, type DetectionColorsResult } from './DetectionColors';
|
|
3
3
|
import { type NormalizedPoint } from './zoneContainment';
|
|
4
4
|
/**
|
|
5
5
|
* Declared website questions the box's own detector answers on the ORIGINAL
|
|
6
6
|
* frame, so the language model is not asked on every frame. Server-selected per
|
|
7
7
|
* camera (retained profile `detectorFields`, CCTV_DETECTOR_FIELDS_SCREENS) and
|
|
8
|
-
* pinned
|
|
9
|
-
*
|
|
8
|
+
* pinned. The legacy methods below retain their measured contracts; the
|
|
9
|
+
* separately selected uniform-colour method declares a lightweight colour
|
|
10
|
+
* proxy, not garment recognition. The question stays declared.
|
|
10
11
|
*
|
|
11
12
|
* Measured 2026-11-04 on the Texas store (docs/runbooks/cctv-detector-tier.md
|
|
12
13
|
* section 5b), the pinned RF-DETR Medium through the detector service's own
|
|
@@ -52,6 +53,103 @@ export interface UnattendedCustomerMethod {
|
|
|
52
53
|
staffFraction: 0.08;
|
|
53
54
|
};
|
|
54
55
|
}
|
|
56
|
+
/** Explicit Pillow 8-bit HSV heuristic bands, not a garment classifier or camera accuracy claim.
|
|
57
|
+
* Bands can overlap (for example red/pink). The selected colour is measured independently.
|
|
58
|
+
*/
|
|
59
|
+
declare const UNIFORM_COLOUR_BANDS: {
|
|
60
|
+
readonly black: {
|
|
61
|
+
readonly hue: readonly [readonly [0, 255]];
|
|
62
|
+
readonly minSaturation: 0;
|
|
63
|
+
readonly maxSaturation: 255;
|
|
64
|
+
readonly minValue: 0;
|
|
65
|
+
readonly maxValue: 59;
|
|
66
|
+
};
|
|
67
|
+
readonly white: {
|
|
68
|
+
readonly hue: readonly [readonly [0, 255]];
|
|
69
|
+
readonly minSaturation: 0;
|
|
70
|
+
readonly maxSaturation: 40;
|
|
71
|
+
readonly minValue: 200;
|
|
72
|
+
readonly maxValue: 255;
|
|
73
|
+
};
|
|
74
|
+
readonly grey: {
|
|
75
|
+
readonly hue: readonly [readonly [0, 255]];
|
|
76
|
+
readonly minSaturation: 0;
|
|
77
|
+
readonly maxSaturation: 40;
|
|
78
|
+
readonly minValue: 60;
|
|
79
|
+
readonly maxValue: 199;
|
|
80
|
+
};
|
|
81
|
+
readonly red: {
|
|
82
|
+
readonly hue: readonly [readonly [0, 10], readonly [240, 255]];
|
|
83
|
+
readonly minSaturation: 100;
|
|
84
|
+
readonly maxSaturation: 255;
|
|
85
|
+
readonly minValue: 60;
|
|
86
|
+
readonly maxValue: 255;
|
|
87
|
+
};
|
|
88
|
+
readonly blue: {
|
|
89
|
+
readonly hue: readonly [readonly [135, 180]];
|
|
90
|
+
readonly minSaturation: 80;
|
|
91
|
+
readonly maxSaturation: 255;
|
|
92
|
+
readonly minValue: 60;
|
|
93
|
+
readonly maxValue: 255;
|
|
94
|
+
};
|
|
95
|
+
readonly green: {
|
|
96
|
+
readonly hue: readonly [readonly [60, 130]];
|
|
97
|
+
readonly minSaturation: 80;
|
|
98
|
+
readonly maxSaturation: 255;
|
|
99
|
+
readonly minValue: 60;
|
|
100
|
+
readonly maxValue: 255;
|
|
101
|
+
};
|
|
102
|
+
readonly yellow: {
|
|
103
|
+
readonly hue: readonly [readonly [30, 50]];
|
|
104
|
+
readonly minSaturation: 100;
|
|
105
|
+
readonly maxSaturation: 255;
|
|
106
|
+
readonly minValue: 100;
|
|
107
|
+
readonly maxValue: 255;
|
|
108
|
+
};
|
|
109
|
+
readonly orange: {
|
|
110
|
+
readonly hue: readonly [readonly [11, 29]];
|
|
111
|
+
readonly minSaturation: 100;
|
|
112
|
+
readonly maxSaturation: 255;
|
|
113
|
+
readonly minValue: 150;
|
|
114
|
+
readonly maxValue: 255;
|
|
115
|
+
};
|
|
116
|
+
readonly purple: {
|
|
117
|
+
readonly hue: readonly [readonly [181, 220]];
|
|
118
|
+
readonly minSaturation: 60;
|
|
119
|
+
readonly maxSaturation: 255;
|
|
120
|
+
readonly minValue: 60;
|
|
121
|
+
readonly maxValue: 255;
|
|
122
|
+
};
|
|
123
|
+
readonly brown: {
|
|
124
|
+
readonly hue: readonly [readonly [11, 29]];
|
|
125
|
+
readonly minSaturation: 80;
|
|
126
|
+
readonly maxSaturation: 255;
|
|
127
|
+
readonly minValue: 60;
|
|
128
|
+
readonly maxValue: 149;
|
|
129
|
+
};
|
|
130
|
+
readonly pink: {
|
|
131
|
+
readonly hue: readonly [readonly [0, 10], readonly [221, 255]];
|
|
132
|
+
readonly minSaturation: 40;
|
|
133
|
+
readonly maxSaturation: 180;
|
|
134
|
+
readonly minValue: 150;
|
|
135
|
+
readonly maxValue: 255;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export type UniformColour = keyof typeof UNIFORM_COLOUR_BANDS;
|
|
139
|
+
export declare const UNIFORM_COLOURS: readonly UniformColour[];
|
|
140
|
+
export interface UniformColourAbsenceMethod {
|
|
141
|
+
field: string;
|
|
142
|
+
method: 'uniform_colour_absence_v1';
|
|
143
|
+
minPersonConfidence: 0.25;
|
|
144
|
+
screenLabels: ['laptop', 'tv'];
|
|
145
|
+
screenContainment: 0.8;
|
|
146
|
+
maxPeople: 32;
|
|
147
|
+
/** Selected colour on a person box; no vest/shirt distinction is inferred. */
|
|
148
|
+
uniform: {
|
|
149
|
+
colour: UniformColour;
|
|
150
|
+
staffFraction: 0.08;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
55
153
|
export interface DetectedLabelsMethod {
|
|
56
154
|
field: string;
|
|
57
155
|
method: 'detected_labels_v1';
|
|
@@ -97,7 +195,7 @@ export interface VehicleOrientationGateMethod {
|
|
|
97
195
|
inheritIou: 0.3;
|
|
98
196
|
};
|
|
99
197
|
}
|
|
100
|
-
export type DetectorFieldMethod = UnattendedCustomerMethod | DetectedLabelsMethod | VehicleArrivalGateMethod | VehicleOrientationGateMethod;
|
|
198
|
+
export type DetectorFieldMethod = UnattendedCustomerMethod | UniformColourAbsenceMethod | DetectedLabelsMethod | VehicleArrivalGateMethod | VehicleOrientationGateMethod;
|
|
101
199
|
export interface DetectorFieldsPolicy {
|
|
102
200
|
version: 1;
|
|
103
201
|
detector: {
|
|
@@ -168,6 +266,42 @@ export declare function decideUnattendedCustomer(input: {
|
|
|
168
266
|
value: boolean;
|
|
169
267
|
trace: UnattendedCustomerTrace;
|
|
170
268
|
};
|
|
269
|
+
export interface UniformColourAbsenceTrace {
|
|
270
|
+
method: 'uniform_colour_absence_v1';
|
|
271
|
+
imageSha256: string;
|
|
272
|
+
policySha256: string;
|
|
273
|
+
colour: UniformColour;
|
|
274
|
+
people: number;
|
|
275
|
+
pictures: number[];
|
|
276
|
+
outside: number[];
|
|
277
|
+
matching: Array<{
|
|
278
|
+
index: number;
|
|
279
|
+
fraction: number;
|
|
280
|
+
}>;
|
|
281
|
+
nonMatching: Array<{
|
|
282
|
+
index: number;
|
|
283
|
+
fraction: number;
|
|
284
|
+
}>;
|
|
285
|
+
}
|
|
286
|
+
/** A person inside the lasso, with no matching-colour person inside that same lasso.
|
|
287
|
+
* Colour is a full person-box pixel proxy. Neither clothing type nor employment is inferred.
|
|
288
|
+
* Missing scope or invalid original-frame evidence is unknown, never an empty/negative result.
|
|
289
|
+
*/
|
|
290
|
+
export declare function decideUniformColourAbsence(input: {
|
|
291
|
+
jpeg: Buffer;
|
|
292
|
+
policy: DetectorFieldsPolicy;
|
|
293
|
+
method: UniformColourAbsenceMethod;
|
|
294
|
+
frame: {
|
|
295
|
+
width: number;
|
|
296
|
+
height: number;
|
|
297
|
+
};
|
|
298
|
+
detections: ReadonlyArray<Detection>;
|
|
299
|
+
colors: DetectionColorsResult;
|
|
300
|
+
region: ReadonlyArray<NormalizedPoint>;
|
|
301
|
+
}): {
|
|
302
|
+
value: boolean;
|
|
303
|
+
trace: UniformColourAbsenceTrace;
|
|
304
|
+
};
|
|
171
305
|
export interface DetectedLabelsTrace {
|
|
172
306
|
method: 'detected_labels_v1';
|
|
173
307
|
imageSha256: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetectorFields.d.ts","sourceRoot":"","sources":["../src/DetectorFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DetectorFields.d.ts","sourceRoot":"","sources":["../src/DetectorFields.ts"],"names":[],"m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