feat: Improve OCR process - replace Tesseract with PaddleOCR (#115) #122
@@ -245,7 +245,7 @@ export const CameraCapture: React.FC<CameraCaptureProps> = ({
|
||||
return (
|
||||
<CropTool
|
||||
imageSrc={capturedImageSrc}
|
||||
lockAspectRatio={guidanceType !== 'none'}
|
||||
lockAspectRatio={guidanceType !== 'none' && guidanceType !== 'vin'}
|
||||
aspectRatio={cropAspectRatio}
|
||||
onConfirm={handleCropConfirm}
|
||||
onReset={handleCropReset}
|
||||
|
||||
@@ -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
|
||||
# no network access is needed at runtime for model download.
|
||||
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"
|
||||
|
||||
COPY . .
|
||||
|
||||
@@ -38,6 +38,7 @@ class PaddleOcrEngine(OcrEngine):
|
||||
use_textline_orientation=True,
|
||||
lang="en",
|
||||
device="cpu",
|
||||
enable_mkldnn=False,
|
||||
)
|
||||
logger.info("PaddleOCR PP-OCRv4 initialized (CPU, textline_orientation=True)")
|
||||
return self._ocr
|
||||
|
||||
Reference in New Issue
Block a user