Update old existing feature extractor references (#24552)
* Update old existing feature extractor references * Typo * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Address comments from review - update 'feature extractor' Co-authored by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -51,7 +51,7 @@ if is_tf_available():
|
||||
if is_vision_available():
|
||||
from PIL import Image
|
||||
|
||||
from transformers import LayoutLMv3FeatureExtractor
|
||||
from transformers import LayoutLMv3ImageProcessor
|
||||
|
||||
|
||||
class TFLayoutLMv3ModelTester:
|
||||
@@ -482,16 +482,16 @@ def prepare_img():
|
||||
@require_tf
|
||||
class TFLayoutLMv3ModelIntegrationTest(unittest.TestCase):
|
||||
@cached_property
|
||||
def default_feature_extractor(self):
|
||||
return LayoutLMv3FeatureExtractor(apply_ocr=False) if is_vision_available() else None
|
||||
def default_image_processor(self):
|
||||
return LayoutLMv3ImageProcessor(apply_ocr=False) if is_vision_available() else None
|
||||
|
||||
@slow
|
||||
def test_inference_no_head(self):
|
||||
model = TFLayoutLMv3Model.from_pretrained("microsoft/layoutlmv3-base")
|
||||
|
||||
feature_extractor = self.default_feature_extractor
|
||||
image_processor = self.default_image_processor
|
||||
image = prepare_img()
|
||||
pixel_values = feature_extractor(images=image, return_tensors="tf").pixel_values
|
||||
pixel_values = image_processor(images=image, return_tensors="tf").pixel_values
|
||||
|
||||
input_ids = tf.constant([[1, 2]])
|
||||
bbox = tf.expand_dims(tf.constant([[1, 2, 3, 4], [5, 6, 7, 8]]), axis=0)
|
||||
|
||||
Reference in New Issue
Block a user