字符识别错误或者无法识别
Search before asking
- I have searched the PaddleOCR Docs and found no similar bug report.
- I have searched the PaddleOCR Issues and found no similar bug report.
- I have searched the PaddleOCR Discussions and found no similar bug report.
Bug (问题描述)
文档中 μg 识别成ug 或者g
文档中前面的点无法识别♂️ Environment (运行环境)
windows python 3.12 GPU paddle 3.2 ocrv6
Minimal Reproducible Example (最小可复现问题的Demo)
PDF_PATH = Path("./test_y.pdf") OUTPUT_DIR = Path("./output") PDF_SCALE = 1.2 # Render each PDF page at 120% of its original size.
def iter_scaled_pdf_pages(pdf_path: Path, scale: float): """Yield each PDF page as an RGB NumPy image rendered at the requested scale.""" document = pdfium.PdfDocument(str(pdf_path)) try: for page_index in range(len(document)): page = document[page_index] try: bitmap = page.render(scale=scale) try: # Copy the pixels before releasing the PDFium bitmap. yield np.asarray(bitmap.to_pil().convert("RGB")).copy() finally: bitmap.close() finally: page.close() finally: document.close()
if not PDF_PATH.is_file(): raise FileNotFoundError(f"PDF file not found: {PDF_PATH.resolve()}")
OUTPUT_DIR.mkdir(parents=True, exist_ok=True) for page_number, page_image in enumerate( iter_scaled_pdf_pages(PDF_PATH, PDF_SCALE), start=1 ): result = ocr.predict(page_image) for res in result: res.print() res.save_to_img(str(OUTPUT_DIR / f"page_{page_number:04d}.png")) res.save_to_json(str(OUTPUT_DIR / f"page_{page_number:04d}.json"))
Source: PaddlePaddle/PaddleOCR