Unverified Commit c60dd98e authored by NielsRogge's avatar NielsRogge Committed by GitHub
Browse files

[LayoutLM] Add clarification to docs (#18716)



* Add clarification

* Add another clarification

* Apply suggestion
Co-authored-by: default avatarNiels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
parent 129d7329
...@@ -67,7 +67,8 @@ occurs. Those can be obtained using the Python Image Library (PIL) library for e ...@@ -67,7 +67,8 @@ occurs. Those can be obtained using the Python Image Library (PIL) library for e
```python ```python
from PIL import Image 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 width, height = image.size
``` ```
......
...@@ -168,7 +168,8 @@ class LayoutLMv2FeatureExtractor(FeatureExtractionMixin, ImageFeatureExtractionM ...@@ -168,7 +168,8 @@ class LayoutLMv2FeatureExtractor(FeatureExtractionMixin, ImageFeatureExtractionM
>>> from transformers import LayoutLMv2FeatureExtractor >>> from transformers import LayoutLMv2FeatureExtractor
>>> from PIL import Image >>> 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) >>> # option 1: with apply_ocr=True (default)
>>> feature_extractor = LayoutLMv2FeatureExtractor() >>> feature_extractor = LayoutLMv2FeatureExtractor()
......
...@@ -179,7 +179,8 @@ class LayoutLMv3FeatureExtractor(FeatureExtractionMixin, ImageFeatureExtractionM ...@@ -179,7 +179,8 @@ class LayoutLMv3FeatureExtractor(FeatureExtractionMixin, ImageFeatureExtractionM
>>> from transformers import LayoutLMv3FeatureExtractor >>> from transformers import LayoutLMv3FeatureExtractor
>>> from PIL import Image >>> 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) >>> # option 1: with apply_ocr=True (default)
>>> feature_extractor = LayoutLMv3FeatureExtractor() >>> feature_extractor = LayoutLMv3FeatureExtractor()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment