Skip to content

Commit

Permalink
[LayoutLM] Add clarification to docs (#18716)
Browse files Browse the repository at this point in the history
* Add clarification

* Add another clarification

* Apply suggestion

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
  • Loading branch information
NielsRogge and Niels Rogge authored Sep 2, 2022
1 parent 129d732 commit c60dd98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/source/en/model_doc/layoutlm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ occurs. Those can be obtained using the Python Image Library (PIL) library for e
```python
from PIL import Image

image = Image.open("name_of_your_document - can be a png file, pdf, etc.")
# Document can be a png, jpg, etc. PDFs must be converted to images.
image = Image.open(name_of_your_document).convert("RGB")

width, height = image.size
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def __call__(
>>> from transformers import LayoutLMv2FeatureExtractor
>>> from PIL import Image
>>> image = Image.open("name_of_your_document - can be a png file, pdf, etc.").convert("RGB")
>>> # Document can be a png, jpg, etc. PDFs must be converted to images.
>>> image = Image.open(name_of_your_document).convert("RGB")
>>> # option 1: with apply_ocr=True (default)
>>> feature_extractor = LayoutLMv2FeatureExtractor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ def __call__(
>>> from transformers import LayoutLMv3FeatureExtractor
>>> from PIL import Image
>>> image = Image.open("name_of_your_document - can be a png file, pdf, etc.").convert("RGB")
>>> # Document can be a png, jpg, etc. PDFs must be converted to images.
>>> image = Image.open(name_of_your_document).convert("RGB")
>>> # option 1: with apply_ocr=True (default)
>>> feature_extractor = LayoutLMv3FeatureExtractor()
Expand Down

0 comments on commit c60dd98

Please sign in to comment.