Fix a couple of typos and add an illustrative test (#26941)

* fix a typo and add an illustrative test

* appease black

* reduce code duplication and add Annotion type back with a pending deprecation warning

* remove unused code

* change warning type

* black formatting fix

* change enum deprecation approach to support 3.8 and earlier

* add stacklevel

* fix black issue

* fix ruff issues

* fix ruff issues

* move tests to own mixin

* include yolos

* fix black formatting issue

* fix black formatting issue

* use logger instead of warnings and include target version for deprecation
This commit is contained in:
rjenc29
2023-12-11 15:51:51 +00:00
committed by GitHub
parent 39acfe84ba
commit 7e35f37071
12 changed files with 279 additions and 191 deletions

View File

@@ -21,7 +21,7 @@ import unittest
from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available
from ...test_image_processing_common import ImageProcessingTestMixin, prepare_image_inputs
from ...test_image_processing_common import AnnotationFormatTestMixin, ImageProcessingTestMixin, prepare_image_inputs
if is_torch_available():
@@ -127,7 +127,7 @@ class DetaImageProcessingTester(unittest.TestCase):
@require_torch
@require_vision
class DetaImageProcessingTest(ImageProcessingTestMixin, unittest.TestCase):
class DetaImageProcessingTest(AnnotationFormatTestMixin, ImageProcessingTestMixin, unittest.TestCase):
image_processing_class = DetaImageProcessor if is_vision_available() else None
def setUp(self):