feat: add detailed logging for scene VLM tags generation

- Log tags count and content after generation
- Log JSON extraction and parsing status
- Log parsed objects and tags count
- Helps debug why vlm_tags may be empty in some cases
This commit is contained in:
Accusys
2026-10-24 12:55:51 +08:00
parent 78169c3bc0
commit b6cf793e1b
+14
View File
@@ -655,7 +655,9 @@ Rules:
// Parse structured JSON; fall back to heuristic extraction if it fails.
if let Some(json_str) = Self::extract_json_object(&content) {
tracing::debug!("[Scene VLM] Extracted JSON object ({} chars)", json_str.len());
if let Ok(parsed) = serde_json::from_str::<serde_json::Value>(json_str) {
tracing::debug!("[Scene VLM] Successfully parsed JSON");
let description = parsed
.get("summary")
.and_then(|v| v.as_str())
@@ -673,6 +675,11 @@ Rules:
})
.unwrap_or_default();
let tags = Self::parse_tags(parsed.get("tags"));
tracing::info!(
"[Scene VLM] Parsed {} objects, {} tags from JSON",
objects.len(),
tags.len()
);
return Ok((description, objects, tags));
}
}
@@ -721,6 +728,13 @@ Rules:
scene.vlm_description = Some(description_en.clone());
scene.vlm_objects = objects.clone();
scene.vlm_tags = tags.clone();
tracing::info!(
"[Scene VLM] Scene {}: Generated {} tags: {:?}",
idx,
tags.len(),
tags
);
// Generate localized description by translation if needed
if preferred_language != "en" {