feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64 - trace_* directories regenerated for KOBA (37 traces, start_frame 5307) - executor.rs: stderr filter now logs all non-empty stderr (was discarding) - VAD not skippable in ASRX (main_fixed.py Step 2 always runs) - Step 2.5 sentence boundary refinement added - Cluster agent async endpoints + similarity transparency - Keyword search: relationship text extraction, priority ordering - Face fix handoff doc for Studio team
This commit is contained in:
@@ -43,7 +43,7 @@ def encode_image(image_path: str) -> str:
|
||||
return base64.b64encode(f.read()).decode("utf-8")
|
||||
|
||||
|
||||
def call_vlm(image_path: str, prompt: str) -> str:
|
||||
def call_vlm(image_path: str, prompt: str, model: str = None) -> str:
|
||||
"""Call VLM API using OpenAI-compatible format."""
|
||||
image_b64 = encode_image(image_path)
|
||||
|
||||
@@ -183,20 +183,31 @@ def analyze_trace(trace_dir: str, model: str = "llava:7b", store_qdrant: bool =
|
||||
print(f"[vlm] Analyzing {trace_path.name}...")
|
||||
|
||||
# Prompt 1: Person description
|
||||
desc_prompt = "Describe this person briefly. Include: gender, age range, hair, visible clothing. If uncertain, say 'unknown'. Be concise and honest."
|
||||
desc_prompt = "Describe this person briefly. For EVERY item, include COLOR: hair color, skin tone, clothing colors. If uncertain, say 'unknown color'. Be concise and honest."
|
||||
description = call_vlm(image_to_analyze, desc_prompt, model)
|
||||
|
||||
# Prompt 2: Clothing details
|
||||
clothing_prompt = "Describe this person's clothing in detail. Include colors, type of clothing, any visible text or logos. If unclear, say 'unclear' or 'partially visible'. Do not guess."
|
||||
clothing_prompt = "Describe this person's clothing in detail. For EACH item, you MUST specify the COLOR: shirt color, pants color, jacket color, hat color, glasses frame color, shoe color. Format: 'color + item' (e.g., 'black hoodie', 'blue jeans'). If color is unclear, say 'unclear color'. Do not skip colors. Include any visible text or logos."
|
||||
clothing = call_vlm(image_to_analyze, clothing_prompt, model)
|
||||
|
||||
# Prompt 3: Tags
|
||||
tags_prompt = "List 5 tags describing this person's appearance, comma-separated. Only include what you can clearly see. Examples: man, glasses, red-shirt, formal, casual."
|
||||
tags_raw = call_vlm(image_to_analyze, tags_prompt, model)
|
||||
tags = [t.strip() for t in tags_raw.replace(",", " ").split() if t.strip()][:5]
|
||||
# Prompt 3: Tags - auto-extract from description
|
||||
tags = []
|
||||
# Simple keyword extraction from description and clothing
|
||||
for text in [description, clothing]:
|
||||
if not text:
|
||||
continue
|
||||
# Look for color+item patterns
|
||||
import re
|
||||
color_patterns = re.findall(r'([a-z]+ (?:hoodie|shirt|pants|jacket|glasses|hat|shoes|beard|hair|sweater|cap|coat))', text.lower())
|
||||
tags.extend([p.strip() for p in color_patterns])
|
||||
# Also add simple descriptors
|
||||
for word in ['man', 'woman', 'glasses', 'beard', 'hat', 'hoodie', 'jacket', 'shirt']:
|
||||
if word in text.lower() and word not in tags:
|
||||
tags.append(word)
|
||||
tags = tags[:5] if tags else ["unknown"]
|
||||
|
||||
# Prompt 5: Objects in hand
|
||||
hand_prompt = "What is this person holding in their hands? Answer: object names if clearly visible, or 'nothing visible', or 'unclear'. Do not guess."
|
||||
hand_prompt = "Look at the person's hands. What objects are they holding or touching? For EACH object, state its COLOR and type (e.g., 'red cup', 'black phone'). If hands not visible, say 'hands not visible'. If empty, say 'empty hands'."
|
||||
hand_objects = call_vlm(image_to_analyze, hand_prompt, model)
|
||||
|
||||
# Prompt 6: Lighting (day/night)
|
||||
@@ -217,7 +228,7 @@ def analyze_trace(trace_dir: str, model: str = "llava:7b", store_qdrant: bool =
|
||||
scene_data = {}
|
||||
|
||||
# Prompt 8: Background description
|
||||
bg_prompt = "Describe the background and environment briefly. Include only what is clearly visible. If uncertain about details, say 'unclear' or 'partially visible'. Do not guess or imagine."
|
||||
bg_prompt = "Describe the background and environment. For EACH visible object, state its COLOR and type. Include: wall color, monitor colors, furniture colors, equipment colors. If color unclear, say 'unclear'."
|
||||
background = call_vlm(image_to_analyze, bg_prompt, model)
|
||||
|
||||
# Prompt 9: Plants detection
|
||||
|
||||
Reference in New Issue
Block a user