Spaces:
Sleeping
Sleeping
Commit History
-
v43: Improve VIN extraction with Korean transliteration and bbox zone detection
Korean PaddleOCR often misreads Latin VIN characters as Korean jamo or garbles them with spaces. This adds three new extraction strategies: - Korean→Latin character transliteration (ㅋ→K, ㅁ→M, etc.) - Bbox-based VIN zone detection (Y:19.5-23%, X:17-70% on cert) - Aggressive zone text cleanup with prefix-based matching Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b821cb1
-
v41: Fix owner name extraction for spaced OCR text
OCR often outputs '성 명 ( 명 칭 )' and '삼 환 교 통' with spaces between each character. Now strips spaces for label matching and collapses spaced Korean names. Also checks next 2 lines (not just 1) for the value row. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b451196 -
v40: Add purchase price (출고가격) field extraction
Extract '자동차출고(취득)가격(부가세제외)' from OCR text. Handles spaced-out Korean characters from OCR. Added to Excel output as '출고가격(원)' column. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e10c4da -
v39: Add model-spec lookup for dimension fill/correction
Known vehicle models (대형승합, 중형승합, 화물 etc.) have fixed specs. When model name is recognized, fill missing fields and correct OCR values that deviate >20% from the standard specification. Models: 슈퍼에어로시티, 일렉시티, 유니버스, 그린시티, 카운티, 마이티, 파비스, 엑시언트, BS106, BS110, FX116, FX120, 레스타 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>babe376 -
v38: Revert to single Korean OCR engine - fix cpu-basic timeout
Root cause: dual-engine (Korean + English) doubled model downloads, memory usage, and processing time, exceeding HF Spaces cpu-basic limits. Reverted to working v32 architecture: - Single Korean PaddleOCR engine (synchronous warmup at startup) - PP-Structure layout engine loads lazily on first OCR request - No background threads, no race conditions - Kept v33 improvements: bbox extraction, Korean fuel, VIN year, date Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9d3eed6 -
v37: Fix race condition - thread-safe OCR engine initialization
Background warmup thread and request thread were racing to initialize the same engine instance, causing 'engine disabled' state. Added threading.Lock with double-checked locking pattern to both LocalPaddleEngine and LayoutEngine singletons. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0737038 -
v35: Skip English engine warmup to prevent startup timeout on cpu-basic
Only pre-init Korean OCR + layout engine at startup. English OCR engine initializes lazily on first request to stay within HF Spaces boot timeout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9e7a67d -
v34: Dual OCR engine (Korean + English) for character-type-aware recognition
- PaddleOCR per-language singleton: korean engine for Korean text fields (차명, 업체명, 차종), en engine for alphanumeric fields (VIN, engine codes, dimensions, weight) - Field-type-aware merge: _merge_dual_ocr() selects best result per field - VIN: prefers engine whose result passes ISO 3779 validation - Numeric fields: prefers engine with more digit content - Korean fields: always uses korean engine - Both engines warmed up at startup to avoid first-request timeout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a3bcb73 -
v33: Improve OCR accuracy - bbox extraction, Korean fuel types, VIN year, date
1. PaddleOCR 3.x bbox extraction: v3 API now returns ocr_results with bounding box coordinates, enabling coordinate-based field extraction that was previously only working on 2.x 2. Fuel type output unified to Korean: 'Gasoline'→'휘발유', 'Diesel'→'경유', 'Electric'→'전기', etc. Matches Korean UI/Excel headers 3. VIN model year decoding: When model year is not found by text parsing, decode it from VIN position 10 (ISO 3779 year code) 4. Registration date extraction: Prefer dates near '최초등록일' label instead of blindly picking the earliest date in the document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fe7f243 -
v32: Disable OCR in PP-Structure to reduce startup time
PP-Structure ocr=True downloads unnecessary models (LaTeX OCR etc.) causing HF Spaces startup timeout. Set ocr=False since we only need layout/table structure detection - text recognition uses PaddleOCR korean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>89da6fa -
v30: Fix connection timeout - warmup engines at startup, restore ssr=False
Pre-initialize PaddleOCR and PP-Structure engines at app import time instead of lazy-loading on first request, preventing timeout on HF Spaces cpu-basic tier. Also restores ssr=False that was accidentally removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2a75ff5 -
v29: Fix PP-Structure lang error - use 'ch' instead of 'korean' for layout
PP-Structure layout models only support 'en' and 'ch' languages. Using 'korean' caused runtime error on HF Spaces that crashed OCR requests. Changed to 'ch' since CJK layout models handle Korean document structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>732efb9 -
v28: Add PP-Structure layout analysis engine for form-aware OCR
Introduce 3-role dev management (Orchestrator/Dev/QAQC) and PP-Structure layout analysis to improve vehicle registration certificate recognition. - Add layout_engine.py: PP-Structure wrapper (singleton, 2.x/3.x compat) - Add form_parser.py: form-aware field extraction from tables + spatial proximity - Integrate ensemble pipeline in processor.py (layout supplements text parsing) - Graceful degradation when PP-Structure unavailable - 14 new tests, all passing - ENABLE_LAYOUT_ANALYSIS env var for toggling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a6c2f2d
-
v24: Port OCR_Vehicle_02 algorithms - preprocessing, bbox extraction, standards
1. Image preprocessing (from OCR_Vehicle_02): - CLAHE contrast enhancement (LAB color space, L-channel only) - Deskew via Hough Line Transform (±15° detection) - Gaussian denoise (3x3 kernel) - DPI increased to 300 2. Coordinate-based field extraction: - PaddleOCR 2.x now returns bounding boxes - Y%/X% zone mapping for model_name, owner, vehicle_type - Supplements text-based regex when it fails 3. Standards-based validation (자동차관리법): - Fuel type OCR corrections (수소전키→수소전기, etc.) - Vehicle type dimension ranges (19 types) - Noise pattern filtering (47 patterns) - Out-of-range values nullified Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>99bdf7f -
v23: Fix fuel detection - Hydrogen before LPG, add H2/FCEV keywords
Hydrogen was misdetected as LPG because LPG was checked first. Now Hydrogen is checked first with expanded keywords: 수소, 수소전기, FCEV, 연료전지, HYDROGEN, H2. Also added engine/model hints for FC. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9ebdf6c -
v22: Fix owner name cleanup for bracketless OCR variants
OCR often drops/garbles brackets: (주)→주, (추]→추]. Now strips leading company-type char even without brackets. Tested: 주삼환교통, 추]삼환교통, (주,추)삼환교통 → all yield 삼환교통 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5ea5f89 -
v21: Fix owner name - use next-line extraction for table layout
Registration certs are tables where headers and values are on separate lines. Now finds 성명(명칭) header line and extracts company name from the line below it, not beside it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>aca3cd3 -
v20: Fix owner name extraction using ⑨ marker and robust label matching
- Label pattern now matches ⑨ 성명(명칭) with flexible spacing - Fallback: ⑨ marker, "9." prefix, 성명(명칭) flexible patterns - Cut owner name at ⑩/주소/double-space boundaries - Clean OCR variants like (주,추), (쥬) via wildcard regex Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>caee81e -
v19: Fix owner name cleanup, model name extraction, weight/capacity parsing
- Owner name: use flexible regex for OCR variants like (주,추), (쥬) etc. - Model name: greedy capture + fallback with ④ marker and known bus models - Total weight: cap regex to max 5 digits, validate <= 99999 kg - Passenger capacity: reject 0, require >= 2, look after kg zone not mm zone Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3a21165 -
v18: ISO 3779 VIN validation, OCR correction, and owner name cleanup
- Implement full VIN validator with check digit computation (ISO 3779) - Add OCR-aware VIN correction: I→1, O→0, Q→0, plus single-char ambiguity resolution (S↔5, B↔8, Z↔2, G↔6) using check digit - Parse VINs from space-stripped text (handles PaddleOCR splitting) - Decode WMI (Korean manufacturers) and model year from VIN - Add _clean_owner_name() to strip (주), 주식회사, (유), etc. - Show VIN validation details in summary output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>88cd424 -
feat: improve VIN extraction and show OCR debug in summary (v17)
- Add near-valid VIN matching (15-17 chars with Korean prefix) - Add multi-line ⑥ marker patterns for VIN detection - Show OCR text preview and parsed fields in summary output - Increase PDF DPI from 150 to 200 for better OCR quality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5d1a454 -
feat: major parser rewrite for robust field extraction (v16)
- Add label-independent fallback extraction for all fields - Fix fuel type: check CNG/LPG/Diesel before Electric in OCR text - Fix dimensions: use document-order sequential extraction from spec zone - Exclude engine displacement (cc) and power (Ps/rpm) from dimensions - Add post-validation to catch dimension/weight swaps - Broaden document verification (circled numbers, mm/kg patterns) - Handle PaddleOCR splitting values and units across lines - Show OCR text preview in skip messages for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8700fa9 -
fix: broaden document type verification and show OCR preview on skip (v15)
- Add more keyword variants: 자동차등록증서, 등록번호, 차량등록, etc. - Add flexible patterns for: 최초등록일, 제원관리, 원동기형식, 승차정원 - Accept documents with Korean VIN pattern (K + 16 chars) - Show OCR text preview in skip message for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4629f65 -
fix: add debug diagnostics for PaddleOCR 3.x result format (v13)
Surface PaddleOCR result structure info in error messages so we can diagnose the exact format returned on HF Spaces. Also fix Gradio 5.x gr.update() deprecation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>63d0d3e -
fix: robust PaddleOCR 3.x result parsing with multi-strategy fallback (v11)
The _detect_text_v3 method was failing with "No text detected" because it assumed a single result format. Now tries 4 parsing strategies to handle different PaddleOCR 3.x versions, with debug logging to diagnose format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>12c1d47
-
fix: show detailed error messages in UI for debugging
Display per-file error/skip reasons in summary text. Add traceback logging for better debugging on HF Spaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>63491a7 -
fix: auto-detect PaddleOCR version and use correct API
Support both 2.x (ocr()) and 3.x (predict()) APIs. Add detailed OCR logging for debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>75ae9f5
-
Remove dead code and fix issues from code review
- Delete src/main.py (imports deleted modules hybrid_engine, vin_logger) - Delete repro_hang.py (debug script importing deleted hybrid_engine) - Remove parse_hybrid(), _calculate_google_confidence(), _calculate_paddle_confidence() from car_registration.py - Fix test_processor.py to mock module-level _preprocessor instance instead of class - Remove redundant self.wb.save() from excel_writer.py append_row() - Remove leftover src/tools/ directory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>66b38fd -
feat: add core processing pipeline (processor.py) and tests
Create src/processor.py orchestrating image preprocessing, PaddleOCR, parsing, validation, and Excel row conversion. Add unit tests with mocked OCR engine for the pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>bce6acc -
feat: add parse_single() method to CarRegistrationParser
Add parse_single() as a simpler alternative to parse_hybrid() for PaddleOCR-only mode. Includes vehicle_no filename fallback and fuel type determination. Add 3 TDD tests covering fuel type, all fields, and filename fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fafec87 -
refactor: simplify config for HF Spaces deployment
Remove Google API settings, dotenv dependency, file-move directories. Keep only OCR and output settings needed for PaddleOCR-only mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d0ea207 -
chore: remove unused files and __pycache__ from tracking
Remove Google Vision engine, hybrid engine, local engine duplicate, Google Sheets storage, VIN CSV logger, debug tools, and unused parsers. Remove __pycache__ bytecode and processed CSV files from git tracking. Prepare for HuggingFace Spaces deployment with PaddleOCR only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5e08aaf
-
Downgrade PaddleOCR from 3.3+ to 2.x API
esketch +1: Claude Opus 4.5- Change from predict() to ocr() method - Update configuration parameters for 2.x compatibility - Adjust result parsing for 2.x format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>0d94afd
-
Add structured parser, template extractor, and fix OCR processing issues
Major changes: - Add structured_parser.py: Circled number (①-㉒) pattern-based extraction - Add template_extractor.py: Position-based field extraction - Fix RGBA PNG handling: Convert RGBA/LA/P to RGB before JPEG conversion - Fix special character filename issue: Sanitize temp file paths with UUID - Add multi-page PDF support with page-level processing - Add archive extraction support (zip, tar, rar, 7z) - Improve VIN extraction with position-based OCR error correction - Update .gitignore with proper exclusions Processing improvements: - 28,539 files processed with 0 errors (previous: 139 errors) - 7,150 files processed with 0 errors - VIN recognition improved with smart L/I/1 and E/I correction Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>0c20a6b
-
Remove .DS_Store files and update .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>48c359e -
Migrate to local OCR (PaddleOCR) and add speed optimizations
- Replace Google Vision API with PaddleOCR 3.3+ for zero cloud costs - Add LocalOCREngine using PaddleOCR with Korean language support - Optimize processing speed (70-80s -> 11-12s per file, ~7x faster) - Use mobile detection model (PP-OCRv5_mobile_det) - Add image size limits and lower thresholds - Add parallel processing with multiprocessing (process_local_fast.py) - Fix document verification for PaddleOCR's spaced text output - Use temp directory for resized files instead of source directory - Add file copy feature: output files named as 차량번호_연료유형.ext Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f3dce36
-
Initial commit
c5ce945