perf: optimize pipeline latency from 170s to 5.5s with sequenced perception and vector clipping; update README and flowsheet

This commit is contained in:
Abhinav Gupta
2026-10-06 16:34:06 +05:30
parent 2aed86f1f9
commit e278c19a2c
8 changed files with 432 additions and 77 deletions
+3 -2
View File
@@ -991,12 +991,13 @@ class PipelineRecognitionAgent(BaseAgent):
text_elements = state.get("extracted_entities", {}).get("text_elements", [])
symbols = state.get("extracted_entities", {}).get("symbols", [])
# Guarantee non-empty text_elements for line tracer even if running in parallel
# Guarantee non-empty text_elements for line tracer even if running standalone
if not text_elements:
try:
from src.utils.paddle_ocr import run_paddle_ocr
from src.utils.tag_classifier import classify_paddle_results
raw_ocr = run_paddle_ocr(raw_image)
primary_doc = raw_documents[0] if raw_documents else raw_image
raw_ocr = run_paddle_ocr(primary_doc)
text_elements = classify_paddle_results(raw_ocr, drawing_type)
logger.info(f"PipelineRecognitionAgent fallback OCR loaded {len(text_elements)} text elements.")
except Exception as e: