deepseek-ai / deepseek-ai/DeepSeek-OCR

No support for pdf input

Open
#33 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23.9k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

During the experiment of using pdf as the input, it showed
```bash
error: cannot identify image file '/home/yiyuanli/Documents/Main/OCR/DeepSeek-OCR/images/MMLUPRO.pdf'
Traceback (most recent call last):
File "/myenv/DeepSeek-OCR-master/DeepSeek-OCR-hf/run_dpsk_ocr.py", line 34, in
res = model.infer(tokenizer, prompt=prompt, image_file=image_file, output_path = output_path, base_size = 1024, image_size = 640, crop_mode = True, save_results = True, test_compress = True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/myenvi/.cache/huggingface/modules/transformers_modules/deepseek-ai/DeepSeek-OCR/59512895521e669adb87064b37e5749fe9b9f5d2/modeling_deepseekocr.py", line 745, in infer
images = load_pil_images(conversation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/myenv/.cache/huggingface/modules/transformers_modules/deepseek-ai/DeepSeek-OCR/59512895521e669adb87064b37e5749fe9b9f5d2/modeling_deepseekocr.py", line 300, in load_pil_images
pil_img = pil_img.convert("RGB")
^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'convert'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.