fix: suppress text fragments in graphic detection
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 28s
CI / test-go-edu-search (push) Successful in 28s
CI / test-python-klausur (push) Failing after 1m56s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 20s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 28s
CI / test-go-edu-search (push) Successful in 28s
CI / test-python-klausur (push) Failing after 1m56s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 20s
- Raise min_area from 30 to 200 (text fragments are small) - Raise word_pad from 3 to 10px (OCR bboxes are tight) - Reduce morph close kernel from 5x5 to 3x3 (avoid reconnecting text) - Tighten arrow detection: min 20px, circularity<0.35, >=2 defects - Add 'noise' category for too-small elements, filter them out - Raise min dimension from 4 to 8px - Add debug logging for word count and exclusion coverage - Raise max_area_ratio to 0.25 (allow larger illustrations) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1236,6 +1236,10 @@ async def detect_structure(session_id: str):
|
||||
for cell in word_result["cells"]:
|
||||
for wb in (cell.get("word_boxes") or []):
|
||||
words.append(wb)
|
||||
logger.info("detect-structure: word_result present=%s, cells=%d, word_boxes extracted=%d",
|
||||
word_result is not None,
|
||||
len(word_result.get("cells", [])) if word_result else 0,
|
||||
len(words))
|
||||
# If no words yet, use image dimensions with small margin
|
||||
if words:
|
||||
content_x = max(0, min(int(wb["left"]) for wb in words))
|
||||
|
||||
Reference in New Issue
Block a user