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:
@@ -45,7 +45,7 @@ if is_torch_available():
|
||||
|
||||
|
||||
if is_vision_available():
|
||||
from transformers import VideoMAEFeatureExtractor
|
||||
from transformers import VideoMAEImageProcessor
|
||||
|
||||
|
||||
class TimesformerModelTester:
|
||||
@@ -339,10 +339,10 @@ def prepare_video():
|
||||
@require_vision
|
||||
class TimesformerModelIntegrationTest(unittest.TestCase):
|
||||
@cached_property
|
||||
def default_feature_extractor(self):
|
||||
def default_image_processor(self):
|
||||
# logits were tested with a different mean and std, so we use the same here
|
||||
return (
|
||||
VideoMAEFeatureExtractor(image_mean=[0.5, 0.5, 0.5], image_std=[0.5, 0.5, 0.5])
|
||||
VideoMAEImageProcessor(image_mean=[0.5, 0.5, 0.5], image_std=[0.5, 0.5, 0.5])
|
||||
if is_vision_available()
|
||||
else None
|
||||
)
|
||||
@@ -353,9 +353,9 @@ class TimesformerModelIntegrationTest(unittest.TestCase):
|
||||
torch_device
|
||||
)
|
||||
|
||||
feature_extractor = self.default_feature_extractor
|
||||
image_processor = self.default_image_processor
|
||||
video = prepare_video()
|
||||
inputs = feature_extractor(video[:8], return_tensors="pt").to(torch_device)
|
||||
inputs = image_processor(video[:8], return_tensors="pt").to(torch_device)
|
||||
|
||||
# forward pass
|
||||
with torch.no_grad():
|
||||
|
||||
Reference in New Issue
Block a user