You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[320](https://github.com/pymupdf/RAG/issues/320) - [Bug] ValueError: min() iterable argument is empty ...
8
+
*[319](https://github.com/pymupdf/RAG/issues/319) - [Bug] ValueError: min() arg is an empty sequence
8
9
9
10
### Other Changes:
10
11
11
-
*xxx
12
+
*OCR invocation now differentiates between full-page OCR and text-only OCR: If the page does contain text but the percentage of unreadable characters exceeds a certain threshold (90%), we only OCR text span boundary boxes and replace span text with OCR'ed text where necessary.
12
13
14
+
------
15
+
16
+
## Changes in version 0.2.0
17
+
18
+
This version introduces full support of the [PyMuPDF-Layout](https://pypi.org/project/pymupdf-layout/) package. This entails a radically new approach for detecting the layout of document pages using the AI-based features of the layout package.
19
+
20
+
Improvements include:
21
+
22
+
* Greatly improved table detection
23
+
* Support of list item hierachy levels
24
+
* Detection of page headers and footers
25
+
* Improved detection of text paragraphs, titles and section headers
26
+
* New output options beyond Markdown: plain text and JSON
27
+
* Automatically detect whether a page needs OCR and invoke Tesseract if both, Tesseract is installed and OpenCV (package [opencv-python](https://pypi.org/project/opencv-python/)) is available. Invocation criteria include absence of readable text, full-page coverage with images, presence of many character-sized vector graphics.
28
+
29
+
The PyMuPDF-Layout package is not open-source and has its own license, which is different from PyMuPDF4LLM. It also is dependent on a number of other, fairly large packages like [onnxruntime](https://pypi.org/project/onnxruntime/), [numpy](https://pypi.org/project/numpy/), [sympy](https://pypi.org/project/sympy/) and [OpenCV](https://pypi.org/project/opencv-python/), which each in turn have their own dependencies.
30
+
31
+
We therefore keep the use of the layout feature optional. To activate PyMuPDF-Layout support the following import statement **_must be included before_** importing PyMuPDF4LLM itself:
32
+
33
+
```python
34
+
import pymupdf.layout
35
+
import pymupdf4llm
36
+
```
37
+
38
+
Thereafter, PyMuPDF's namespace is available. The known method `pymupdf4llm.to_markdown()` automatically works with AI-based empowerment.
39
+
In addition, two new methods become available:
40
+
*`pymupdf4llm.to_text()` - which works much like markdown output but produces plain text.
41
+
*`pymupdf4llm.to_json()` - which outputs the document's metadata and the selected pages in JSON format.
42
+
43
+
### Fixes:
44
+
45
+
46
+
### Other Changes:
47
+
48
+
* If `show_progress=True`, Python package [tqdm](https://pypi.org/project/tqdm/) is automatically used when available to display a progress bar. If tqdm is not installed, our own text-based progress bar is used.
0 commit comments