Add ViTImageProcessorFast to tests (#31424)
* Add ViTImageProcessor to tests * Correct data format * Review comments
This commit is contained in:
@@ -17,6 +17,8 @@ import json
|
||||
import pathlib
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from transformers.testing_utils import require_torch, require_vision, slow
|
||||
from transformers.utils import is_torch_available, is_vision_available
|
||||
|
||||
@@ -86,6 +88,8 @@ class DetrImageProcessingTester(unittest.TestCase):
|
||||
image = image_inputs[0]
|
||||
if isinstance(image, Image.Image):
|
||||
w, h = image.size
|
||||
elif isinstance(image, np.ndarray):
|
||||
h, w = image.shape[0], image.shape[1]
|
||||
else:
|
||||
h, w = image.shape[1], image.shape[2]
|
||||
if w < h:
|
||||
|
||||
Reference in New Issue
Block a user