Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCR predictor returns empty detection in docTR 0.11.0 #1892

Open
AmineM24 opened this issue Mar 10, 2025 · 2 comments
Open

OCR predictor returns empty detection in docTR 0.11.0 #1892

AmineM24 opened this issue Mar 10, 2025 · 2 comments
Labels
awaiting response Waiting for feedback type: bug Something isn't working

Comments

@AmineM24
Copy link

Bug description

I've encountered an issue after upgrading to docTR version 0.11.0. When I run the OCR predictor on images that previously worked fine with version 0.8.1, I now get empty detection results.

Could this be a regression or something related to default configurations introduced in recent updates? Any insights or guidance would be appreciated

Thanks a lot

Code snippet to reproduce the bug

from PIL import Image
import numpy as np

model = ocr_predictor(pretrained=True)

img = Image.open("my_image.png").convert("RGB")
arr = np.array(img)
result = model([arr]).export()
print(result)

The exact same code and image provide normal OCR results (detected blocks of text) when downgrading back to version 0.8.1.

Error traceback

I don't get any error messages, but instead, the result contains no detected text blocks

{'pages': [{'page_idx': 0, 'dimensions': (1600, 1131), 'orientation': {'value': None, 'confidence': None}, 'language': {'value': None, 'confidence': None}, 'blocks': []}]

Environment

DocTR version: v0.11.0
TensorFlow version: 2.18.0
PyTorch version: 2.5.1+cu124 (torchvision 0.20.1+cu124)
OpenCV version: 4.11.0
OS: Ubuntu 22.04.4 LTS
Python version: 3.11.11
Is CUDA available (TensorFlow): Yes
Is CUDA available (PyTorch): Yes
CUDA runtime version: 12.5.82
GPU models and configuration: GPU 0: Tesla T4
Nvidia driver version: 550.54.15
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.2.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.2.1

Deep Learning backend

is_tf_available: True
is_torch_available: True

@AmineM24 AmineM24 added the type: bug Something isn't working label Mar 10, 2025
@felixdittrich92
Copy link
Contributor

felixdittrich92 commented Mar 10, 2025

Hi @AmineM24 👋,

Seems to be related to #1884

If you have both backends (TF and PyTorch) in the same env installed please use the USE_TF= and USE_TORCH= env vars ..there is any conflicting dependency between PyTorch and TensorFlow

@felixdittrich92 felixdittrich92 added the awaiting response Waiting for feedback label Mar 11, 2025
@felixdittrich92
Copy link
Contributor

Any update @AmineM24 ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Waiting for feedback type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants