feat: Improve OCR process - replace Tesseract with PaddleOCR (#115) #122

Merged
egullickson merged 16 commits from issue-115-improve-ocr-paddleocr into main 2026-02-08 01:13:35 +00:00
3 changed files with 3 additions and 2 deletions
Showing only changes of commit dab4a3bdf3 - Show all commits

View File

@@ -245,7 +245,7 @@ export const CameraCapture: React.FC<CameraCaptureProps> = ({
return ( return (
<CropTool <CropTool
imageSrc={capturedImageSrc} imageSrc={capturedImageSrc}
lockAspectRatio={guidanceType !== 'none'} lockAspectRatio={guidanceType !== 'none' && guidanceType !== 'vin'}
aspectRatio={cropAspectRatio} aspectRatio={cropAspectRatio}
onConfirm={handleCropConfirm} onConfirm={handleCropConfirm}
onReset={handleCropReset} onReset={handleCropReset}

View File

@@ -37,7 +37,7 @@ RUN pip install --no-cache-dir -r requirements.txt \
# Models are baked into the image so container starts are fast and # Models are baked into the image so container starts are fast and
# no network access is needed at runtime for model download. # no network access is needed at runtime for model download.
ENV PADDLE_PDX_DISABLE_MODEL_SOURCE_CHECK=True ENV PADDLE_PDX_DISABLE_MODEL_SOURCE_CHECK=True
RUN python -c "from paddleocr import PaddleOCR; PaddleOCR(ocr_version='PP-OCRv4', use_textline_orientation=True, lang='en', device='cpu')" \ RUN python -c "from paddleocr import PaddleOCR; PaddleOCR(ocr_version='PP-OCRv4', use_textline_orientation=True, lang='en', device='cpu', enable_mkldnn=False)" \
&& echo "PaddleOCR PP-OCRv4 models downloaded and verified" && echo "PaddleOCR PP-OCRv4 models downloaded and verified"
COPY . . COPY . .

View File

@@ -38,6 +38,7 @@ class PaddleOcrEngine(OcrEngine):
use_textline_orientation=True, use_textline_orientation=True,
lang="en", lang="en",
device="cpu", device="cpu",
enable_mkldnn=False,
) )
logger.info("PaddleOCR PP-OCRv4 initialized (CPU, textline_orientation=True)") logger.info("PaddleOCR PP-OCRv4 initialized (CPU, textline_orientation=True)")
return self._ocr return self._ocr