Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ecb5a79
Fix tensor index finding with caching for reid
jakubsikorski Feb 6, 2026
9f159c3
Add doc with pipelines and metadata
jakubsikorski Feb 6, 2026
75b9c9d
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 6, 2026
d05b08e
Merge branch 'main' into reid_pipelines
saratpoluri Feb 6, 2026
1c57f45
Add links to JSON files as example raw output
jakubsikorski Feb 9, 2026
546f0a5
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 9, 2026
b0af1de
Fix scenescape policy to not loose metadata during ReID policy
jakubsikorski Feb 9, 2026
fdce922
Add full person attributes pipeline with metadata output as examples
jakubsikorski Feb 9, 2026
e554d4a
Refactor to limit code duplication
jakubsikorski Feb 9, 2026
5bd8367
Update classificationPolicy to preserve confidence of all used models
jakubsikorski Feb 9, 2026
22a37cd
Update scenescape example to contain model confidence
jakubsikorski Feb 9, 2026
bea0346
Update the markdown file to follow an actual document structure
jakubsikorski Feb 9, 2026
17d9631
Adjust document to fix broken markdown
jakubsikorski Feb 9, 2026
27235a5
Run prettier write and rename to `jsonl`
jakubsikorski Feb 9, 2026
b31200f
Add jsonl files to reuse ignore
jakubsikorski Feb 9, 2026
fba85c1
Add reid-pipelines to toctree
jakubsikorski Feb 9, 2026
bf23eac
fix toctree
jakubsikorski Feb 9, 2026
92bccc4
Update age gender scenescape metadata output
jakubsikorski Feb 9, 2026
35f37e0
Update personattr scenescape metadata
jakubsikorski Feb 9, 2026
53b0a31
Refactor reid and classification policies to represent metadata struc…
jakubsikorski Feb 10, 2026
70611eb
Update metadata output in the doc after code changes
jakubsikorski Feb 10, 2026
d79adb3
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 10, 2026
a0ff8d6
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 10, 2026
86aff5c
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 11, 2026
f9302d9
Merge branch 'main' into reid_pipelines
jakubsikorski Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ path = [
"version.txt",
"third-party-programs.txt",
"**/*_data.txt",
"**/*_json.txt"
"**/*_json.txt",
"**/*.jsonl"
]
precedence = "override"
SPDX-FileCopyrightText = "(C) 2025 Intel Corporation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,77 @@ def detection3DPolicy(pobj, item, fw, fh):
print(f"Warning: No bounding box or rotation data found in item {item}")
return

def reidPolicy(pobj, item, fw, fh):
detectionPolicy(pobj, item, fw, fh)
reid_vector = item['tensors'][1]['data']
v = struct.pack("256f",*reid_vector)
pobj['reid'] = base64.b64encode(v).decode('utf-8')
def reidPolicy(pobj, item, fw, fh, _cache={}):
# First apply classification policy (handles detection + classification metadata)
classificationPolicy(pobj, item, fw, fh)

# Then add REID embedding to metadata
if 'reid_index' not in _cache:
for idx, tensor in enumerate(item.get('tensors', [])):
if tensor.get('layer_name') == 'reid_embedding':
_cache['reid_index'] = idx
break
else:
# No REID tensor found - cache None to avoid repeated searches
_cache['reid_index'] = None

reid_idx = _cache.get('reid_index')
if reid_idx is None:
return

tensors = item.get('tensors', [])
if reid_idx >= len(tensors):
return

reid_tensor = tensors[reid_idx]
reid_vector = reid_tensor.get('data', [])
if not reid_vector:
return

v = struct.pack(f"{len(reid_vector)}f", *reid_vector)

# Ensure metadata exists
if 'metadata' not in pobj:
pobj['metadata'] = {}

pobj['metadata']['reid'] = {
'embedding': base64.b64encode(v).decode('utf-8')
}

# Add model info if available
model_name = reid_tensor.get('model_name')
if model_name:
pobj['metadata']['reid']['model'] = model_name

return


def classificationPolicy(pobj, item, fw, fh):
"""Extract detection and classification metadata from tensors."""
detectionPolicy(pobj, item, fw, fh)
categories = {}
for tensor in item.get('tensors', [{}]):
name = tensor.get('name','')
if name and name != 'detection':
categories[name] = tensor.get('label','')
pobj.update(categories)

metadata = {}

for tensor in item.get('tensors', []):
name = tensor.get('name', '')
if not name or name == 'detection' or tensor.get('layer_name') == 'reid_embedding':
continue

# Build metadata entry
meta_entry = {'label': tensor.get('label', '')}

confidence = tensor.get('confidence')
if confidence is not None:
meta_entry['confidence'] = confidence

model_name = tensor.get('model_name')
if model_name:
meta_entry['model'] = model_name
metadata[name] = meta_entry

if metadata:
pobj['metadata'] = metadata

return

def ocrPolicy(pobj, item, fw, fh):
Expand Down
Loading
Loading