feature_extraction_layoutlmv2.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # coding=utf-8
  2. # Copyright 2021 The HuggingFace Inc. team.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. """
  16. Feature extractor class for LayoutLMv2.
  17. """
  18. import warnings
  19. from ...utils import logging
  20. from .image_processing_layoutlmv2 import LayoutLMv2ImageProcessor
  21. logger = logging.get_logger(__name__)
  22. class LayoutLMv2FeatureExtractor(LayoutLMv2ImageProcessor):
  23. def __init__(self, *args, **kwargs) -> None:
  24. warnings.warn(
  25. "The class LayoutLMv2FeatureExtractor is deprecated and will be removed in version 5 of Transformers."
  26. " Please use LayoutLMv2ImageProcessor instead.",
  27. FutureWarning,
  28. )
  29. super().__init__(*args, **kwargs)