feat: Improve OCR process - replace Tesseract with PaddleOCR (#115) #122
@@ -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}
|
||||||
|
|||||||
@@ -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 . .
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user