@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.
- package/THIRD-PARTY-NOTICES.md +220 -0
- package/deploy/detector/bench/actor-appearance-qualified-v1.json +106 -0
- package/deploy/detector/bench/actor-appearance.md +52 -0
- package/deploy/detector/bench/export_actor_appearance.py +134 -0
- package/deploy/detector/bench/qualify_actor_appearance.py +77 -0
- package/deploy/detector/bench/qualify_actor_appearance_client.cjs +50 -0
- package/deploy/detector/bench/qualify_actor_appearance_wire.py +170 -0
- package/deploy/detector/bench/requirements-appearance-export.txt +4 -0
- package/deploy/detector/pyproject.toml +1 -1
- package/deploy/detector/tests/fixtures/actor-appearance-original-g326-v1.json +27105 -0
- package/deploy/detector/tests/test_actor_appearance_tracking.py +196 -0
- package/deploy/detector/tests/test_appearance_wire.py +80 -0
- package/deploy/detector/tests/test_loader.py +9 -7
- package/deploy/detector/trillboards_detector/_version.py +2 -2
- package/deploy/detector/trillboards_detector/actor_identity.py +323 -0
- package/deploy/detector/trillboards_detector/actor_tracking.py +163 -1
- package/deploy/detector/trillboards_detector/appearance.py +149 -0
- package/deploy/detector/trillboards_detector/loader.py +6 -0
- package/deploy/detector/trillboards_detector/registry.py +30 -1
- package/deploy/detector/trillboards_detector/server.py +56 -1
- package/deploy/detector/trillboards_detector/tasks.py +7 -1
- package/dist/ActorAppearance.d.ts +13 -0
- package/dist/ActorAppearance.d.ts.map +1 -0
- package/dist/ActorAppearance.js +17 -0
- package/dist/ActorAppearance.js.map +1 -0
- package/dist/ActorPerception.d.ts +2 -0
- package/dist/ActorPerception.d.ts.map +1 -1
- package/dist/ActorPerception.js +12 -5
- package/dist/ActorPerception.js.map +1 -1
- package/dist/ActorTracking.d.ts +3 -1
- package/dist/ActorTracking.d.ts.map +1 -1
- package/dist/ActorTracking.js +10 -3
- package/dist/ActorTracking.js.map +1 -1
- package/dist/EdgeAgent.js +1 -1
- package/dist/LocalDetectorClient.d.ts +2 -1
- package/dist/LocalDetectorClient.d.ts.map +1 -1
- package/dist/LocalDetectorClient.js +9 -2
- package/dist/LocalDetectorClient.js.map +1 -1
- package/dist/RuntimeModelSelection.d.ts.map +1 -1
- package/dist/RuntimeModelSelection.js +15 -1
- package/dist/RuntimeModelSelection.js.map +1 -1
- package/dist/diagnose.d.ts +1 -1
- package/dist/diagnose.js +1 -1
- package/package.json +2 -2
- package/retained/__tests__/actor-perception.test.cjs +29 -6
- package/retained/manager.cjs +20 -9
|
@@ -20,6 +20,10 @@ from pathlib import Path
|
|
|
20
20
|
|
|
21
21
|
from .detections import Detection
|
|
22
22
|
from .actor_checkpoint import encode_tracker, restore_tracker
|
|
23
|
+
from .actor_identity import (
|
|
24
|
+
ActorIdentitySegments, POLICY as IDENTITY_POLICY, checked_appearance,
|
|
25
|
+
MODEL_ID as IDENTITY_MODEL_ID,
|
|
26
|
+
)
|
|
23
27
|
|
|
24
28
|
ALGORITHM = "bytetrack_2.6.1"
|
|
25
29
|
_ID = re.compile(r"[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}\Z")
|
|
@@ -82,6 +86,7 @@ class ActorTrackerJournal:
|
|
|
82
86
|
self._max_cameras, self._retained_frames = max_cameras, retained_frames
|
|
83
87
|
self._lock = threading.RLock()
|
|
84
88
|
self._cache = {}
|
|
89
|
+
self._identity_cache = {}
|
|
85
90
|
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
|
86
91
|
self._db = sqlite3.connect(str(path), timeout=30, check_same_thread=False, isolation_level=None)
|
|
87
92
|
self._db.execute("PRAGMA journal_mode=WAL")
|
|
@@ -96,6 +101,11 @@ class ActorTrackerJournal:
|
|
|
96
101
|
input_json TEXT NOT NULL, result_json TEXT NOT NULL,
|
|
97
102
|
PRIMARY KEY(camera_id,frame_id), UNIQUE(camera_id,seq));
|
|
98
103
|
CREATE INDEX IF NOT EXISTS actor_frame_replay ON actor_frame(camera_id,epoch,seq);
|
|
104
|
+
CREATE TABLE IF NOT EXISTS actor_motion_frame (
|
|
105
|
+
camera_id TEXT NOT NULL, frame_id TEXT NOT NULL, result_json TEXT NOT NULL,
|
|
106
|
+
PRIMARY KEY(camera_id,frame_id));
|
|
107
|
+
CREATE TABLE IF NOT EXISTS actor_identity_checkpoint (
|
|
108
|
+
camera_id TEXT PRIMARY KEY, seq INTEGER NOT NULL, payload_json TEXT NOT NULL);
|
|
99
109
|
CREATE TABLE IF NOT EXISTS actor_checkpoint (
|
|
100
110
|
camera_id TEXT PRIMARY KEY, seq INTEGER NOT NULL, payload_json TEXT NOT NULL);
|
|
101
111
|
""")
|
|
@@ -103,6 +113,7 @@ class ActorTrackerJournal:
|
|
|
103
113
|
def close(self):
|
|
104
114
|
with self._lock:
|
|
105
115
|
self._cache.clear()
|
|
116
|
+
self._identity_cache.clear()
|
|
106
117
|
self._db.close()
|
|
107
118
|
|
|
108
119
|
def retained_frames(self, camera_id):
|
|
@@ -208,6 +219,62 @@ class ActorTrackerJournal:
|
|
|
208
219
|
except (ValueError,TypeError,KeyError) as error:
|
|
209
220
|
raise TrackingError("Corrupt physical tracker checkpoint") from error
|
|
210
221
|
|
|
222
|
+
|
|
223
|
+
def _identity_record(self, camera, head):
|
|
224
|
+
record = self._db.execute(
|
|
225
|
+
"SELECT seq,payload_json FROM actor_identity_checkpoint WHERE camera_id=?",
|
|
226
|
+
(camera,)).fetchone()
|
|
227
|
+
if record is None:
|
|
228
|
+
return None
|
|
229
|
+
try:
|
|
230
|
+
if head is None or len(record[1].encode()) > 16 * 1024**2:
|
|
231
|
+
raise ValueError("identity checkpoint has no camera head or exceeds capacity")
|
|
232
|
+
value = json.loads(record[1])
|
|
233
|
+
unsigned = {k: v for k, v in value.items() if k != "sha256"}
|
|
234
|
+
frame = self._db.execute(
|
|
235
|
+
"SELECT frame_id,fingerprint,input_json,result_json FROM actor_frame "
|
|
236
|
+
"WHERE camera_id=? AND seq=?", (camera, head[3])).fetchone()
|
|
237
|
+
if frame is None:
|
|
238
|
+
raise ValueError("identity checkpoint lost its original head observation")
|
|
239
|
+
_, saved = self._checked_frame(
|
|
240
|
+
camera, frame[0], head[1], frame[1], frame[2], frame[3])
|
|
241
|
+
if (set(value) != {"version","cameraId","sourceId","epoch","contextSha256",
|
|
242
|
+
"seq","frameFingerprint","model","policy","state","sha256"}
|
|
243
|
+
or value["version"] != 1 or value["sha256"] != _hash(unsigned)
|
|
244
|
+
or value["cameraId"] != camera or value["sourceId"] != saved["sourceId"]
|
|
245
|
+
or value["epoch"] != head[1] or value["contextSha256"] != head[0]
|
|
246
|
+
or value["seq"] != head[3] or record[0] != head[3]
|
|
247
|
+
or value["frameFingerprint"] != frame[1]
|
|
248
|
+
or value["model"] != saved.get("identityModel")):
|
|
249
|
+
raise ValueError("identity checkpoint binding changed")
|
|
250
|
+
state = value["state"]
|
|
251
|
+
if state.get("stateSha256") != _hash(
|
|
252
|
+
{k:v for k,v in state.items() if k != "stateSha256"}):
|
|
253
|
+
raise ValueError("identity checkpoint state changed")
|
|
254
|
+
self._checked_active(_json([t["actor"] for t in state["tracks"].values()]),
|
|
255
|
+
camera, head[1])
|
|
256
|
+
return value
|
|
257
|
+
except (ValueError, TypeError, KeyError) as error:
|
|
258
|
+
raise TrackingError("Corrupt physical identity checkpoint") from error
|
|
259
|
+
|
|
260
|
+
def _save_identity_checkpoint(self, camera, request, context, epoch, seq,
|
|
261
|
+
fingerprint, model, identity):
|
|
262
|
+
payload = {"version":1,"cameraId":camera,"sourceId":request["sourceId"],
|
|
263
|
+
"epoch":epoch,"contextSha256":context,"seq":seq,
|
|
264
|
+
"frameFingerprint":fingerprint,"model":model,
|
|
265
|
+
"policy":IDENTITY_POLICY,"state":identity.snapshot()}
|
|
266
|
+
payload["sha256"] = _hash(payload)
|
|
267
|
+
raw = _json(payload)
|
|
268
|
+
if len(raw.encode()) > 16 * 1024**2:
|
|
269
|
+
raise TrackingError("Physical identity checkpoint exceeds capacity")
|
|
270
|
+
try:
|
|
271
|
+
self._db.execute(
|
|
272
|
+
"INSERT INTO actor_identity_checkpoint VALUES (?,?,?) "
|
|
273
|
+
"ON CONFLICT(camera_id) DO UPDATE SET seq=excluded.seq,payload_json=excluded.payload_json",
|
|
274
|
+
(camera, seq, raw))
|
|
275
|
+
except sqlite3.Error as error:
|
|
276
|
+
raise TrackingError("Cannot checkpoint physical person continuity") from error
|
|
277
|
+
|
|
211
278
|
def _recover(self, camera, epoch, config=None, expected_active=None):
|
|
212
279
|
tracker, identities = self._new_tracker(config), {}
|
|
213
280
|
reverse = {}
|
|
@@ -215,6 +282,14 @@ class ActorTrackerJournal:
|
|
|
215
282
|
"SELECT frame_id,fingerprint,input_json,result_json FROM actor_frame WHERE camera_id=? AND epoch=? ORDER BY seq",
|
|
216
283
|
(camera, epoch)):
|
|
217
284
|
frame, saved = self._checked_frame(camera, frame_id, epoch, fingerprint, input_json, result_json)
|
|
285
|
+
if frame.get("appearance") is not None:
|
|
286
|
+
motion = self._db.execute(
|
|
287
|
+
"SELECT result_json FROM actor_motion_frame WHERE camera_id=? AND frame_id=?",
|
|
288
|
+
(camera, frame_id)).fetchone()
|
|
289
|
+
if motion is None:
|
|
290
|
+
raise TrackingError("Missing committed native motion receipt")
|
|
291
|
+
_, saved = self._checked_frame(
|
|
292
|
+
camera, frame_id, epoch, fingerprint, input_json, motion[0])
|
|
218
293
|
expected = {a["detectionIndex"]: a["actor"] for a in saved["actors"]}
|
|
219
294
|
for index, tid in self._update(tracker, frame["detections"], frame["request"]["capturedAtMs"]):
|
|
220
295
|
if tid < 0 or index not in expected:
|
|
@@ -232,7 +307,8 @@ class ActorTrackerJournal:
|
|
|
232
307
|
raise _RecoveryConflict("Bounded actor history cannot prove the committed active identities")
|
|
233
308
|
return tracker, identities
|
|
234
309
|
|
|
235
|
-
def track(self, request, detections, *, image_sha256, model_hashes, frame_size
|
|
310
|
+
def track(self, request, detections, *, image_sha256, model_hashes, frame_size,
|
|
311
|
+
appearance=None):
|
|
236
312
|
request = validate_tracking_request(request)
|
|
237
313
|
if (not isinstance(image_sha256, str) or not _SHA.fullmatch(image_sha256)
|
|
238
314
|
or not isinstance(model_hashes, dict) or not 1 <= len(model_hashes) <= 16
|
|
@@ -253,10 +329,25 @@ class ActorTrackerJournal:
|
|
|
253
329
|
raise TrackingError("Invalid detection in actor frame")
|
|
254
330
|
values.append(asdict(d))
|
|
255
331
|
config = self._config
|
|
332
|
+
if appearance is not None:
|
|
333
|
+
try:
|
|
334
|
+
appearance = checked_appearance(appearance, values, image_sha256, frame_size)
|
|
335
|
+
except (ValueError, TypeError, KeyError) as error:
|
|
336
|
+
raise TrackingError("Invalid original native appearance evidence") from error
|
|
337
|
+
model_hashes = dict(model_hashes)
|
|
338
|
+
previous = model_hashes.get(appearance["modelId"])
|
|
339
|
+
if previous is not None and previous != appearance["sha256"]:
|
|
340
|
+
raise TrackingError("Native appearance model proof conflicts")
|
|
341
|
+
model_hashes[appearance["modelId"]] = appearance["sha256"]
|
|
342
|
+
if len(model_hashes) > 16:
|
|
343
|
+
raise TrackingError("Loaded actor model proof exceeds capacity")
|
|
344
|
+
config = {**config, "identityPolicySha256": _hash(IDENTITY_POLICY)}
|
|
256
345
|
context = _hash({"sourceId": request["sourceId"], "modelHashes": model_hashes,
|
|
257
346
|
"frameSize": list(frame_size), "config": config})
|
|
258
347
|
inputs = {"request": request, "detections": values, "imageSha256": image_sha256,
|
|
259
348
|
"contextSha256": context}
|
|
349
|
+
if appearance is not None:
|
|
350
|
+
inputs["appearance"] = appearance
|
|
260
351
|
fingerprint = _hash(inputs)
|
|
261
352
|
camera, captured_at = request["cameraId"], request["capturedAtMs"]
|
|
262
353
|
with self._lock:
|
|
@@ -317,6 +408,63 @@ class ActorTrackerJournal:
|
|
|
317
408
|
"actors": sorted(actors, key=lambda a: a["detectionIndex"]),
|
|
318
409
|
"unconfirmed": sorted(unconfirmed), "endedActors": ended}
|
|
319
410
|
result["sha256"] = _hash(result)
|
|
411
|
+
motion_json = _json(result)
|
|
412
|
+
identity = None
|
|
413
|
+
old_identity = None
|
|
414
|
+
identity_cached = self._identity_cache.get(camera)
|
|
415
|
+
if head and continuity != "continued":
|
|
416
|
+
if identity_cached and identity_cached[0] == head[3]:
|
|
417
|
+
old_identity = identity_cached[1].snapshot()
|
|
418
|
+
else:
|
|
419
|
+
previous_identity = self._identity_record(camera, head)
|
|
420
|
+
old_identity = previous_identity["state"] if previous_identity else None
|
|
421
|
+
if appearance is not None:
|
|
422
|
+
binding = {"cameraId":camera,"sourceId":request["sourceId"],"motionEpoch":epoch}
|
|
423
|
+
if continuity == "continued":
|
|
424
|
+
if identity_cached and identity_cached[0] == head[3]:
|
|
425
|
+
identity = identity_cached[1]
|
|
426
|
+
else:
|
|
427
|
+
saved_identity = self._identity_record(camera, head)
|
|
428
|
+
if saved_identity is None:
|
|
429
|
+
raise TrackingError("Missing committed physical identity checkpoint")
|
|
430
|
+
try:
|
|
431
|
+
identity = ActorIdentitySegments(
|
|
432
|
+
binding, appearance["sha256"], state=saved_identity["state"])
|
|
433
|
+
except (ValueError, TypeError, KeyError) as error:
|
|
434
|
+
raise TrackingError("Cannot recover physical person continuity") from error
|
|
435
|
+
else:
|
|
436
|
+
identity = ActorIdentitySegments(binding, appearance["sha256"])
|
|
437
|
+
descriptors = {d["detectionIndex"]:d for d in appearance["descriptors"]}
|
|
438
|
+
candidates = []
|
|
439
|
+
for a in result["actors"]:
|
|
440
|
+
d = descriptors[a["detectionIndex"]]
|
|
441
|
+
box = values[a["detectionIndex"]]
|
|
442
|
+
candidates.append({
|
|
443
|
+
"motionActor":a["actor"],
|
|
444
|
+
"box":[box["x"],box["y"],box["x"]+box["width"],box["y"]+box["height"]],
|
|
445
|
+
"descriptor":{"modelSha256":appearance["sha256"],
|
|
446
|
+
"sourceImageSha256":image_sha256,
|
|
447
|
+
"inputSha256":d["inputSha256"],"values":d["embedding"]}})
|
|
448
|
+
physical = identity.process({
|
|
449
|
+
**binding, "frameId":request["frameId"], "sequence":seq,
|
|
450
|
+
"capturedAtMs":captured_at, "imageSha256":image_sha256,
|
|
451
|
+
"candidates":candidates})
|
|
452
|
+
result["actors"] = [
|
|
453
|
+
{"detectionIndex":a["detectionIndex"],"actor":p["actor"]}
|
|
454
|
+
for a,p in zip(result["actors"],physical["actors"])]
|
|
455
|
+
result["endedActors"] = physical["endedActors"]
|
|
456
|
+
result["identityModel"] = {
|
|
457
|
+
k:appearance[k] for k in ("modelId","sha256","preprocessing")}
|
|
458
|
+
if old_identity is not None:
|
|
459
|
+
result["endedActors"] += [
|
|
460
|
+
t["actor"] for t in old_identity["tracks"].values()]
|
|
461
|
+
result["sha256"] = _hash({k:v for k,v in result.items() if k != "sha256"})
|
|
462
|
+
elif old_identity is not None:
|
|
463
|
+
result["endedActors"] = [t["actor"] for t in old_identity["tracks"].values()]
|
|
464
|
+
result["sha256"] = _hash({k:v for k,v in result.items() if k != "sha256"})
|
|
465
|
+
if appearance is not None:
|
|
466
|
+
self._db.execute("INSERT INTO actor_motion_frame VALUES (?,?,?)",
|
|
467
|
+
(camera, request["frameId"], motion_json))
|
|
320
468
|
self._db.execute("INSERT INTO actor_frame VALUES (?,?,?,?,?,?,?)",
|
|
321
469
|
(camera, request["frameId"], seq, epoch, fingerprint, _json(inputs), _json(result)))
|
|
322
470
|
self._db.execute(
|
|
@@ -325,13 +473,27 @@ class ActorTrackerJournal:
|
|
|
325
473
|
"seq=excluded.seq,active_json=excluded.active_json",
|
|
326
474
|
(camera, context, epoch, captured_at, seq, _json(active)))
|
|
327
475
|
self._save_checkpoint(camera,context,epoch,captured_at,seq,fingerprint,tracker,identities)
|
|
476
|
+
if appearance is not None:
|
|
477
|
+
self._save_identity_checkpoint(
|
|
478
|
+
camera, request, context, epoch, seq, fingerprint,
|
|
479
|
+
result["identityModel"], identity)
|
|
480
|
+
else:
|
|
481
|
+
self._db.execute("DELETE FROM actor_identity_checkpoint WHERE camera_id=?", (camera,))
|
|
328
482
|
self._db.execute("DELETE FROM actor_frame WHERE camera_id=? AND seq<=?",
|
|
329
483
|
(camera, seq-self._retained_frames))
|
|
484
|
+
self._db.execute(
|
|
485
|
+
"DELETE FROM actor_motion_frame WHERE camera_id=? AND frame_id NOT IN "
|
|
486
|
+
"(SELECT frame_id FROM actor_frame WHERE camera_id=?)", (camera,camera))
|
|
330
487
|
self._db.execute("COMMIT")
|
|
331
488
|
self._cache[camera] = (seq, tracker, identities)
|
|
489
|
+
if identity is not None:
|
|
490
|
+
self._identity_cache[camera] = (seq, identity)
|
|
491
|
+
else:
|
|
492
|
+
self._identity_cache.pop(camera, None)
|
|
332
493
|
return json.loads(_json(result))
|
|
333
494
|
except BaseException:
|
|
334
495
|
if self._db.in_transaction:
|
|
335
496
|
self._db.execute("ROLLBACK")
|
|
336
497
|
self._cache.pop(camera, None)
|
|
498
|
+
self._identity_cache.pop(camera, None)
|
|
337
499
|
raise
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""Pinned OSNet appearance from each observed original person rectangle."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import io
|
|
7
|
+
import math
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import threading
|
|
10
|
+
import time
|
|
11
|
+
|
|
12
|
+
import cv2
|
|
13
|
+
import numpy as np
|
|
14
|
+
import onnxruntime as ort
|
|
15
|
+
from PIL import Image
|
|
16
|
+
|
|
17
|
+
from .actor_identity import MODEL_ID, MODEL_SHA256, PREPROCESSING
|
|
18
|
+
from .errors import ModelContractError
|
|
19
|
+
from .execution import LocalOrtSession
|
|
20
|
+
|
|
21
|
+
cv2.setNumThreads(1)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class PersonAppearanceEstimator:
|
|
25
|
+
"""One immutable CPU artifact; decoding and inference share a bounded lock."""
|
|
26
|
+
|
|
27
|
+
model_name = MODEL_ID
|
|
28
|
+
model_sha256 = MODEL_SHA256
|
|
29
|
+
|
|
30
|
+
def __init__(self, model_path, *, intra_op_threads=4, accelerator="cpu"):
|
|
31
|
+
if type(intra_op_threads) is not int or not 1 <= intra_op_threads <= 8:
|
|
32
|
+
raise ValueError("Invalid bounded appearance thread count")
|
|
33
|
+
if accelerator != "cpu":
|
|
34
|
+
raise ModelContractError(
|
|
35
|
+
"This appearance artifact is qualified for native CPU execution"
|
|
36
|
+
)
|
|
37
|
+
raw = Path(model_path).read_bytes()
|
|
38
|
+
if hashlib.sha256(raw).hexdigest() != MODEL_SHA256:
|
|
39
|
+
raise ModelContractError(
|
|
40
|
+
"Person appearance artifact differs from the pinned native export"
|
|
41
|
+
)
|
|
42
|
+
options = ort.SessionOptions()
|
|
43
|
+
options.intra_op_num_threads = intra_op_threads
|
|
44
|
+
options.inter_op_num_threads = 1
|
|
45
|
+
options.log_severity_level = 3
|
|
46
|
+
self._session = LocalOrtSession(ort, raw, options, "cpu")
|
|
47
|
+
inputs = self._session.get_inputs()
|
|
48
|
+
outputs = self._session.get_outputs()
|
|
49
|
+
if (
|
|
50
|
+
len(inputs) != 1
|
|
51
|
+
or inputs[0].name != "data"
|
|
52
|
+
or inputs[0].shape != [1, 3, 256, 128]
|
|
53
|
+
or inputs[0].type != "tensor(float)"
|
|
54
|
+
or len(outputs) != 1
|
|
55
|
+
or outputs[0].name != "reid_embedding/sink_port_0"
|
|
56
|
+
or outputs[0].shape != [1, 256]
|
|
57
|
+
or outputs[0].type != "tensor(float)"
|
|
58
|
+
):
|
|
59
|
+
raise ModelContractError(
|
|
60
|
+
"Person appearance graph differs from its BGR/fp32 embedding contract"
|
|
61
|
+
)
|
|
62
|
+
self._lock = threading.Lock()
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def acceleration(self):
|
|
66
|
+
return self._session.acceleration
|
|
67
|
+
|
|
68
|
+
def estimate(self, jpeg, boxes):
|
|
69
|
+
if (
|
|
70
|
+
not isinstance(jpeg, bytes)
|
|
71
|
+
or not 0 < len(jpeg) <= 16 * 1024**2
|
|
72
|
+
or not isinstance(boxes, list)
|
|
73
|
+
or len(boxes) > 256
|
|
74
|
+
):
|
|
75
|
+
raise ValueError("Invalid bounded original person appearance request")
|
|
76
|
+
try:
|
|
77
|
+
with Image.open(io.BytesIO(jpeg)) as header:
|
|
78
|
+
width, height = header.size
|
|
79
|
+
if (
|
|
80
|
+
header.format != "JPEG"
|
|
81
|
+
or not 2 <= width <= 8192
|
|
82
|
+
or not 2 <= height <= 8192
|
|
83
|
+
or width * height > 16777216
|
|
84
|
+
):
|
|
85
|
+
raise ValueError("Appearance requires a bounded original JPEG")
|
|
86
|
+
except Exception as error:
|
|
87
|
+
raise ValueError("Invalid original person appearance JPEG") from error
|
|
88
|
+
bounds = []
|
|
89
|
+
for box in boxes:
|
|
90
|
+
if (
|
|
91
|
+
not isinstance(box, (list, tuple))
|
|
92
|
+
or len(box) != 4
|
|
93
|
+
or any(
|
|
94
|
+
isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v)
|
|
95
|
+
for v in box
|
|
96
|
+
)
|
|
97
|
+
or not 0 <= box[0] < box[2] <= width + 0.01
|
|
98
|
+
or not 0 <= box[1] < box[3] <= height + 0.01
|
|
99
|
+
):
|
|
100
|
+
raise ValueError("Appearance rectangle is outside the original person frame")
|
|
101
|
+
bounds.append(
|
|
102
|
+
[
|
|
103
|
+
math.floor(box[0]),
|
|
104
|
+
math.floor(box[1]),
|
|
105
|
+
min(width, math.ceil(box[2])),
|
|
106
|
+
min(height, math.ceil(box[3])),
|
|
107
|
+
]
|
|
108
|
+
)
|
|
109
|
+
started = time.monotonic()
|
|
110
|
+
descriptors = []
|
|
111
|
+
with self._lock:
|
|
112
|
+
image = cv2.imdecode(np.frombuffer(jpeg, np.uint8), cv2.IMREAD_COLOR)
|
|
113
|
+
if image is None or image.shape != (height, width, 3):
|
|
114
|
+
raise ValueError("Original appearance JPEG could not be decoded")
|
|
115
|
+
for left, top, right, bottom in bounds:
|
|
116
|
+
person = image[top:bottom, left:right]
|
|
117
|
+
tensor = np.ascontiguousarray(
|
|
118
|
+
cv2.resize(person, (128, 256), interpolation=cv2.INTER_LINEAR).transpose(
|
|
119
|
+
2, 0, 1
|
|
120
|
+
)[None],
|
|
121
|
+
dtype=np.float32,
|
|
122
|
+
)
|
|
123
|
+
embedding = self._session.run(["reid_embedding/sink_port_0"], {"data": tensor})[0]
|
|
124
|
+
if embedding.shape != (1, 256) or not np.isfinite(embedding).all():
|
|
125
|
+
raise ModelContractError("Native appearance output is invalid")
|
|
126
|
+
embedding = embedding.reshape(256)
|
|
127
|
+
norm = float(np.linalg.norm(embedding))
|
|
128
|
+
if not math.isfinite(norm) or norm <= 1e-12:
|
|
129
|
+
raise ModelContractError(
|
|
130
|
+
"Native appearance output cannot identify a person segment"
|
|
131
|
+
)
|
|
132
|
+
embedding = embedding / norm
|
|
133
|
+
descriptors.append(
|
|
134
|
+
{
|
|
135
|
+
"bounds": [left, top, right, bottom],
|
|
136
|
+
"inputSha256": hashlib.sha256(tensor.tobytes()).hexdigest(),
|
|
137
|
+
"embedding": embedding.tolist(),
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
return {
|
|
141
|
+
"version": 1,
|
|
142
|
+
"modelId": MODEL_ID,
|
|
143
|
+
"modelSha256": MODEL_SHA256,
|
|
144
|
+
"preprocessing": PREPROCESSING,
|
|
145
|
+
"imageSha256": hashlib.sha256(jpeg).hexdigest(),
|
|
146
|
+
"frameSize": {"width": width, "height": height},
|
|
147
|
+
"descriptors": descriptors,
|
|
148
|
+
"inferenceMs": (time.monotonic() - started) * 1000,
|
|
149
|
+
}
|
|
@@ -168,6 +168,9 @@ class DetectorLoader:
|
|
|
168
168
|
if entry.vocabulary.task == "actor_actions":
|
|
169
169
|
from .actor_actions import ActorActionEstimator
|
|
170
170
|
return ActorActionEstimator(entry.path,entry.vocabulary,intra_op_threads=self._intra_op_threads or 4,accelerator=self._accelerator)
|
|
171
|
+
if entry.vocabulary.task == "actor_appearance":
|
|
172
|
+
from .appearance import PersonAppearanceEstimator
|
|
173
|
+
return PersonAppearanceEstimator(entry.path, intra_op_threads=self._intra_op_threads or 4, accelerator="cpu")
|
|
171
174
|
from .pose import PoseEstimator
|
|
172
175
|
return PoseEstimator(entry.path, intra_op_threads=self._intra_op_threads or 4, accelerator=self._accelerator)
|
|
173
176
|
from .session import OnnxDetector
|
|
@@ -312,6 +315,9 @@ class DetectorLoader:
|
|
|
312
315
|
def estimate_pose(self, jpeg: bytes, boxes: list, expected_model: dict) -> dict:
|
|
313
316
|
return self.registry.estimate_pose(jpeg, boxes, expected_model)
|
|
314
317
|
|
|
318
|
+
def estimate_appearance(self, jpeg: bytes, boxes: list, expected_model: dict) -> dict:
|
|
319
|
+
return self.registry.estimate_appearance(jpeg, boxes, expected_model)
|
|
320
|
+
|
|
315
321
|
def classify_actor_actions(self,batch):
|
|
316
322
|
return self.registry.classify_actor_actions(batch)
|
|
317
323
|
|
|
@@ -123,7 +123,7 @@ class TaskModelContract:
|
|
|
123
123
|
self._validate_task()
|
|
124
124
|
|
|
125
125
|
def _validate_task(self):
|
|
126
|
-
if self.task
|
|
126
|
+
if self.task not in {"pose_coco17", "actor_appearance"}:
|
|
127
127
|
raise ValueError("invalid non-box task kind")
|
|
128
128
|
|
|
129
129
|
class ModelEntry:
|
|
@@ -500,6 +500,35 @@ class ModelRegistry:
|
|
|
500
500
|
finally:
|
|
501
501
|
self._release([state.entry.name])
|
|
502
502
|
|
|
503
|
+
def estimate_appearance(self, jpeg: bytes, boxes: list, expected_model: dict) -> dict:
|
|
504
|
+
"""Acquire appearance through the same portfolio as all detector sessions."""
|
|
505
|
+
state = self._states.get(expected_model.get("modelId"))
|
|
506
|
+
if (state is None or not isinstance(state.entry.vocabulary, TaskModelContract)
|
|
507
|
+
or state.entry.vocabulary.task != "actor_appearance"
|
|
508
|
+
or state.entry.vocabulary.sha256 != expected_model.get("sha256")):
|
|
509
|
+
raise ModelVerificationError("selected appearance task does not match its immutable contract")
|
|
510
|
+
contract = state.entry.vocabulary
|
|
511
|
+
sessions = self._acquire([state.entry.name])
|
|
512
|
+
try:
|
|
513
|
+
session = sessions[0]
|
|
514
|
+
if getattr(session, "model_sha256", None) != contract.sha256:
|
|
515
|
+
raise ModelVerificationError("loaded appearance session does not match the selected artifact")
|
|
516
|
+
try:
|
|
517
|
+
result = session.estimate(jpeg, boxes)
|
|
518
|
+
if (result.get("modelId") != contract.model_name
|
|
519
|
+
or result.get("modelSha256") != contract.sha256
|
|
520
|
+
or result.get("preprocessing") != contract.preprocessing):
|
|
521
|
+
raise ModelVerificationError("appearance output does not match its task contract")
|
|
522
|
+
except Exception:
|
|
523
|
+
with self._lock:
|
|
524
|
+
state.detect_failures += 1
|
|
525
|
+
raise
|
|
526
|
+
with self._lock:
|
|
527
|
+
state.detect_count += 1
|
|
528
|
+
return result
|
|
529
|
+
finally:
|
|
530
|
+
self._release([state.entry.name])
|
|
531
|
+
|
|
503
532
|
def classify_actor_actions(self,batch):
|
|
504
533
|
"""Acquire and prove the selected non-box action model through the shared portfolio."""
|
|
505
534
|
from .actor_action_contract import ActorActionModelContract
|
|
@@ -35,6 +35,7 @@ import threading
|
|
|
35
35
|
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
36
36
|
|
|
37
37
|
from .actor_tracking import TrackingError, validate_tracking_request
|
|
38
|
+
from .actor_identity import MODEL_ID as APPEARANCE_MODEL_ID, MODEL_SHA256 as APPEARANCE_SHA256, PREPROCESSING as APPEARANCE_PREPROCESSING, checked_appearance
|
|
38
39
|
from .tasks import RTMPOSE_MODEL_ID, RTMPOSE_SHA256, RTMPOSE_PREPROCESSING, COCO17
|
|
39
40
|
from .actor_action_wire import parse_actor_action_request, validate_actor_action_response
|
|
40
41
|
from ._version import VERSION
|
|
@@ -241,6 +242,48 @@ def parse_pose_model(raw: bytes):
|
|
|
241
242
|
return value
|
|
242
243
|
|
|
243
244
|
|
|
245
|
+
def parse_appearance_model(raw: bytes):
|
|
246
|
+
body = json.loads(raw.decode("utf-8"))
|
|
247
|
+
if "appearance_model" not in body:
|
|
248
|
+
return None
|
|
249
|
+
value = body["appearance_model"]
|
|
250
|
+
if (not isinstance(value, dict) or set(value) != {"modelId", "sha256"}
|
|
251
|
+
or value.get("modelId") != APPEARANCE_MODEL_ID
|
|
252
|
+
or value.get("sha256") != APPEARANCE_SHA256):
|
|
253
|
+
raise WireError(409, "appearance task differs from its pinned artifact contract")
|
|
254
|
+
return value
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def build_appearance_evidence(result, image_sha256, frame_size, detections):
|
|
258
|
+
people = [(index, detection) for index, detection in enumerate(detections)
|
|
259
|
+
if detection.label == "person"]
|
|
260
|
+
if (not isinstance(result, dict) or result.get("version") != 1
|
|
261
|
+
or result.get("modelId") != APPEARANCE_MODEL_ID
|
|
262
|
+
or result.get("modelSha256") != APPEARANCE_SHA256
|
|
263
|
+
or result.get("preprocessing") != APPEARANCE_PREPROCESSING
|
|
264
|
+
or result.get("imageSha256") != image_sha256
|
|
265
|
+
or result.get("frameSize") != {"width": frame_size[0], "height": frame_size[1]}
|
|
266
|
+
or not isinstance(result.get("descriptors"), list)
|
|
267
|
+
or len(result["descriptors"]) != len(people)
|
|
268
|
+
or isinstance(result.get("inferenceMs"), bool)
|
|
269
|
+
or not isinstance(result.get("inferenceMs"), (int, float))
|
|
270
|
+
or not math.isfinite(result["inferenceMs"]) or result["inferenceMs"] < 0):
|
|
271
|
+
raise ValueError("Appearance result differs from the original detected frame")
|
|
272
|
+
descriptors = []
|
|
273
|
+
for (index, _), descriptor in zip(people, result["descriptors"]):
|
|
274
|
+
if (not isinstance(descriptor, dict)
|
|
275
|
+
or set(descriptor) != {"bounds", "inputSha256", "embedding"}):
|
|
276
|
+
raise ValueError("Invalid native appearance descriptor")
|
|
277
|
+
descriptors.append({**descriptor, "detectionIndex": index,
|
|
278
|
+
"modelSha256": result["modelSha256"],
|
|
279
|
+
"sourceImageSha256": result["imageSha256"]})
|
|
280
|
+
evidence = {"modelId": result["modelId"], "sha256": result["modelSha256"],
|
|
281
|
+
"preprocessing": result["preprocessing"], "descriptors": descriptors}
|
|
282
|
+
boxes = [{"label": d.label, "x": d.x, "y": d.y,
|
|
283
|
+
"width": d.width, "height": d.height} for d in detections]
|
|
284
|
+
return checked_appearance(evidence, boxes, image_sha256, frame_size)
|
|
285
|
+
|
|
286
|
+
|
|
244
287
|
def build_pose_response(result, tracking, frame_size):
|
|
245
288
|
if (result.get("version") != 1 or result.get("modelId") != RTMPOSE_MODEL_ID
|
|
246
289
|
or result.get("modelSha256") != RTMPOSE_SHA256
|
|
@@ -356,11 +399,16 @@ class DetectorHandler(BaseHTTPRequestHandler):
|
|
|
356
399
|
jpeg, min_confidence, requested = parse_detect_request(raw)
|
|
357
400
|
expected_model = parse_expected_model(raw)
|
|
358
401
|
pose_model = parse_pose_model(raw)
|
|
402
|
+
appearance_model = parse_appearance_model(raw)
|
|
359
403
|
tracking = json.loads(raw.decode("utf-8")).get("tracking")
|
|
360
404
|
if pose_model is not None and tracking is None:
|
|
361
405
|
raise WireError(400, "pose requires original-frame actor tracking")
|
|
362
406
|
if pose_model is not None and not hasattr(loader, "estimate_pose"):
|
|
363
407
|
raise WireError(503, "pose task is unavailable in this detector build")
|
|
408
|
+
if appearance_model is not None and tracking is None:
|
|
409
|
+
raise WireError(400, "appearance requires original-frame actor tracking")
|
|
410
|
+
if appearance_model is not None and not hasattr(loader, "estimate_appearance"):
|
|
411
|
+
raise WireError(503, "appearance task is unavailable in this detector build")
|
|
364
412
|
if tracking is not None:
|
|
365
413
|
try:
|
|
366
414
|
tracking = validate_tracking_request(tracking)
|
|
@@ -427,9 +475,16 @@ class DetectorHandler(BaseHTTPRequestHandler):
|
|
|
427
475
|
or body["model"] != expected_model["modelId"]):
|
|
428
476
|
raise ValueError("selected detector did not return its loaded artifact proof")
|
|
429
477
|
if tracking is not None:
|
|
478
|
+
appearance = None
|
|
479
|
+
if appearance_model is not None:
|
|
480
|
+
boxes = [[d.x, d.y, d.x + d.width, d.y + d.height]
|
|
481
|
+
for d in batch.detections if d.label == "person"]
|
|
482
|
+
result = loader.estimate_appearance(jpeg, boxes, appearance_model)
|
|
483
|
+
appearance = build_appearance_evidence(
|
|
484
|
+
result, hashlib.sha256(jpeg).hexdigest(), frame_size, batch.detections)
|
|
430
485
|
body["tracking"] = self.server.actor_tracker.track(
|
|
431
486
|
tracking, batch.detections, image_sha256=hashlib.sha256(jpeg).hexdigest(),
|
|
432
|
-
model_hashes=body.get("model_hashes"), frame_size=frame_size)
|
|
487
|
+
model_hashes=body.get("model_hashes"), frame_size=frame_size, appearance=appearance)
|
|
433
488
|
if pose_model is not None:
|
|
434
489
|
boxes = []
|
|
435
490
|
for association in body["tracking"]["actors"]:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Typed non-box contracts. Presence does not grant detection classes."""
|
|
2
2
|
from .registry import TaskModelContract
|
|
3
|
+
from .actor_identity import MODEL_ID as APPEARANCE_MODEL_ID, MODEL_SHA256 as APPEARANCE_SHA256, PREPROCESSING as APPEARANCE_PREPROCESSING
|
|
3
4
|
from .actor_action_contract import ActorActionModelContract,ActorActionOutput,ActorActionWindowContract,CONTACT_PREPROCESSING
|
|
4
5
|
|
|
5
6
|
RTMPOSE_MODEL_ID = "rtmpose_m_body7"
|
|
@@ -19,7 +20,12 @@ PHONE_ACTION_E3 = ActorActionModelContract(
|
|
|
19
20
|
window=ActorActionWindowContract(),requires_pose=True)
|
|
20
21
|
# Development artifacts are exercised through explicit test catalogues only.
|
|
21
22
|
# Adding one to this default catalogue requires independent qualification.
|
|
22
|
-
|
|
23
|
+
# Native CPU qualification: 93 original person crops match the official FP32
|
|
24
|
+
# export; measured incremental residency 85.6 MB. No action-field ownership.
|
|
25
|
+
PERSON_APPEARANCE = TaskModelContract(
|
|
26
|
+
APPEARANCE_MODEL_ID, "actor_appearance", APPEARANCE_SHA256,
|
|
27
|
+
256 * 1024**2, APPEARANCE_PREPROCESSING)
|
|
28
|
+
BUILTIN_TASK_MODELS = (RTMPOSE_BODY7, PERSON_APPEARANCE)
|
|
23
29
|
|
|
24
30
|
COCO17 = ("nose", "left_eye", "right_eye", "left_ear", "right_ear",
|
|
25
31
|
"left_shoulder", "right_shoulder", "left_elbow", "right_elbow",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The native person-appearance helper owns identity continuity, never an action field. */
|
|
2
|
+
export declare const PERSON_APPEARANCE_MODEL_ID = "person_reid_osnet_0277";
|
|
3
|
+
export declare const PERSON_APPEARANCE_SHA256 = "a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d";
|
|
4
|
+
export declare const PERSON_APPEARANCE_PREPROCESSING = "osnet_bgr_linear_128x256_raw_fp32_l2_v1";
|
|
5
|
+
export interface ActorAppearancePin {
|
|
6
|
+
modelId: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ActorIdentityModelProof extends ActorAppearancePin {
|
|
10
|
+
preprocessing: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function validateActorAppearancePin(value: unknown): ActorAppearancePin;
|
|
13
|
+
//# sourceMappingURL=ActorAppearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorAppearance.d.ts","sourceRoot":"","sources":["../src/ActorAppearance.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,2BAAyB,CAAC;AACjE,eAAO,MAAM,wBAAwB,qEAAmE,CAAC;AACzG,eAAO,MAAM,+BAA+B,4CAA0C,CAAC;AACvF,MAAM,WAAW,kBAAkB;IAAE,OAAO,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,MAAM,CAAA;CAAC;AAClE,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IAAE,aAAa,EAAC,MAAM,CAAA;CAAC;AAC1F,wBAAgB,0BAA0B,CAAC,KAAK,EAAC,OAAO,GAAE,kBAAkB,CAO3E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERSON_APPEARANCE_PREPROCESSING = exports.PERSON_APPEARANCE_SHA256 = exports.PERSON_APPEARANCE_MODEL_ID = void 0;
|
|
4
|
+
exports.validateActorAppearancePin = validateActorAppearancePin;
|
|
5
|
+
/** The native person-appearance helper owns identity continuity, never an action field. */
|
|
6
|
+
exports.PERSON_APPEARANCE_MODEL_ID = 'person_reid_osnet_0277';
|
|
7
|
+
exports.PERSON_APPEARANCE_SHA256 = 'a26d1586786a09529801517061b84fad833ba07992c1881cc417f935c3c9097d';
|
|
8
|
+
exports.PERSON_APPEARANCE_PREPROCESSING = 'osnet_bgr_linear_128x256_raw_fp32_l2_v1';
|
|
9
|
+
function validateActorAppearancePin(value) {
|
|
10
|
+
const v = value;
|
|
11
|
+
if (!v || typeof v !== 'object' || Array.isArray(v)
|
|
12
|
+
|| Object.keys(v).sort().join(',') !== 'modelId,sha256'
|
|
13
|
+
|| v.modelId !== exports.PERSON_APPEARANCE_MODEL_ID || v.sha256 !== exports.PERSON_APPEARANCE_SHA256)
|
|
14
|
+
throw Error('Invalid pinned native actor appearance model');
|
|
15
|
+
return { ...v };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ActorAppearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorAppearance.js","sourceRoot":"","sources":["../src/ActorAppearance.ts"],"names":[],"mappings":";;;AAMA,gEAOC;AAbD,2FAA2F;AAC9E,QAAA,0BAA0B,GAAC,wBAAwB,CAAC;AACpD,QAAA,wBAAwB,GAAC,kEAAkE,CAAC;AAC5F,QAAA,+BAA+B,GAAC,yCAAyC,CAAC;AAGvF,SAAgB,0BAA0B,CAAC,KAAa;IACtD,MAAM,CAAC,GAAC,KAA2B,CAAC;IACpC,IAAG,CAAC,CAAC,IAAE,OAAO,CAAC,KAAG,QAAQ,IAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;WACxC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAG,gBAAgB;WAClD,CAAC,CAAC,OAAO,KAAG,kCAA0B,IAAE,CAAC,CAAC,MAAM,KAAG,gCAAwB;QAC7E,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAC9D,OAAO,EAAC,GAAG,CAAC,EAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ActorAppearancePin } from './ActorAppearance';
|
|
1
2
|
import { type DetectResult, type DetectorHttpPoster } from './LocalDetectorClient';
|
|
2
3
|
import { type ActorPosePin } from './ActorPose';
|
|
3
4
|
export interface ActorPerceptionPolicy {
|
|
@@ -9,6 +10,7 @@ export interface ActorPerceptionPolicy {
|
|
|
9
10
|
sha256: string;
|
|
10
11
|
};
|
|
11
12
|
pose?: ActorPosePin;
|
|
13
|
+
appearance?: ActorAppearancePin;
|
|
12
14
|
minConfidence: number;
|
|
13
15
|
}
|
|
14
16
|
export interface ActorPerceptionInput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorPerception.d.ts","sourceRoot":"","sources":["../src/ActorPerception.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAC,KAAK,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEpG,OAAO,EAA2C,KAAK,YAAY,EAAC,MAAM,aAAa,CAAC;AAIxF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAC,CAAC,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAC;IAC1C,QAAQ,EAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,MAAM,EAAC,MAAM,CAAA;KAAC,CAAC;IAAA,IAAI,CAAC,EAAC,YAAY,CAAC;IAAA,aAAa,EAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ActorPerception.d.ts","sourceRoot":"","sources":["../src/ActorPerception.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAqB,KAAK,YAAY,EAAC,KAAK,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEpG,OAAO,EAA2C,KAAK,YAAY,EAAC,MAAM,aAAa,CAAC;AAIxF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAC,CAAC,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAC;IAC1C,QAAQ,EAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,MAAM,EAAC,MAAM,CAAA;KAAC,CAAC;IAAA,IAAI,CAAC,EAAC,YAAY,CAAC;IAAA,UAAU,CAAC,EAAC,kBAAkB,CAAC;IAAA,aAAa,EAAC,MAAM,CAAC;CAChH;AACD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAC,MAAM,CAAC;IAAA,YAAY,EAAC,MAAM,CAAC;IAAA,IAAI,EAAC,MAAM,CAAC;IAAA,aAAa,EAAC,MAAM,CAAC;CACrE;AACD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAC,CAAC,CAAC;IAAA,YAAY,EAAC,MAAM,CAAC;IAAA,aAAa,EAAC,MAAM,CAAC;IAAA,MAAM,EAAC,YAAY,CAAC;CACxE;AAMD,wBAAgB,0BAA0B,CAAC,KAAK,EAAC,OAAO,GAAE,qBAAqB,CAc9E;AAED,+FAA+F;AAC/F,wBAAgB,kCAAkC,CAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC;IAAC,QAAQ,EAAC,MAAM,CAAC;IAAA,QAAQ,EAAC,MAAM,CAAA;CAAC,GAAE,qBAAqB,GAAC,IAAI,CAgBrI;AAED,iGAAiG;AACjG,qBAAa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAF5B,QAAQ,CAAC,MAAM,EAAC,qBAAqB,CAAC;gBAC1B,MAAM,EAAC,qBAAqB,EACrB,SAAS,GAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAC;QAAA,SAAS,CAAC,EAAC,MAAM,CAAC;QAAA,MAAM,CAAC,EAAC,kBAAkB,CAAA;KAAI;IAG9F,OAAO,CAAC,OAAO;IAOT,QAAQ,CAAC,KAAK,EAAC,oBAAoB,EAAC,KAAK,GAAC,qBAAiC,GAAE,OAAO,CAAC,oBAAoB,CAAC;IAOhH,QAAQ,CAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,EAAC,WAAW,GAAC,qBAAiC,GAAE,oBAAoB;CA2BtH;AAED,0FAA0F;AAC1F,qBAAa,6BAA6B;IAC5B,QAAQ,CAAC,OAAO,EAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAA,QAAQ,EAAC,MAAM,CAAA;KAAC;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADP,OAAO,EAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAA,QAAQ,EAAC,MAAM,CAAA;KAAC,EAC3C,SAAS,GAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAC;QAAA,SAAS,CAAC,EAAC,MAAM,CAAC;QAAA,MAAM,CAAC,EAAC,kBAAkB,CAAA;KAAI;IAI9F,gBAAgB,CAAC,OAAO,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,GAAC,SAAS,GAAE,qBAAqB,GAAC,IAAI;IAGrF,OAAO,CAAC,MAAM;IAKd,QAAQ,CAAC,KAAK,EAAC,oBAAoB,EAAC,MAAM,EAAC,qBAAqB,GAAE,OAAO,CAAC,oBAAoB,CAAC;IAG/F,QAAQ,CAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,EAAC,MAAM,EAAC,qBAAqB,GAAE,oBAAoB;CAGrG"}
|