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:
@@ -655,7 +655,9 @@ Rules:
|
|||||||
|
|
||||||
// Parse structured JSON; fall back to heuristic extraction if it fails.
|
// Parse structured JSON; fall back to heuristic extraction if it fails.
|
||||||
if let Some(json_str) = Self::extract_json_object(&content) {
|
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) {
|
if let Ok(parsed) = serde_json::from_str::<serde_json::Value>(json_str) {
|
||||||
|
tracing::debug!("[Scene VLM] Successfully parsed JSON");
|
||||||
let description = parsed
|
let description = parsed
|
||||||
.get("summary")
|
.get("summary")
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
@@ -673,6 +675,11 @@ Rules:
|
|||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let tags = Self::parse_tags(parsed.get("tags"));
|
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));
|
return Ok((description, objects, tags));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -721,6 +728,13 @@ Rules:
|
|||||||
scene.vlm_description = Some(description_en.clone());
|
scene.vlm_description = Some(description_en.clone());
|
||||||
scene.vlm_objects = objects.clone();
|
scene.vlm_objects = objects.clone();
|
||||||
scene.vlm_tags = tags.clone();
|
scene.vlm_tags = tags.clone();
|
||||||
|
|
||||||
|
tracing::info!(
|
||||||
|
"[Scene VLM] Scene {}: Generated {} tags: {:?}",
|
||||||
|
idx,
|
||||||
|
tags.len(),
|
||||||
|
tags
|
||||||
|
);
|
||||||
|
|
||||||
// Generate localized description by translation if needed
|
// Generate localized description by translation if needed
|
||||||
if preferred_language != "en" {
|
if preferred_language != "en" {
|
||||||
|
|||||||
Reference in New Issue
Block a user