Spaces:
Runtime error
Runtime error
fix
Browse files
utils.py
CHANGED
@@ -89,7 +89,6 @@ class Image2Text:
|
|
89 |
def load_img(self, inputs, width=480, height=480):
|
90 |
images = [load_image(input_) for input_ in inputs]
|
91 |
images = [aspect_ratio_preserving_resize_and_crop(image, target_width=width, target_height=height) for image in images]
|
92 |
-
img = self.processor(image , return_tensors="pt", size=(width, height)).pixel_values
|
93 |
imgs = self.processor([image.convert("RGB") for image in images], return_tensors="pt", size=(width, height)).pixel_values
|
94 |
pixel_values = imgs.to(self.device)
|
95 |
return pixel_values
|
|
|
89 |
def load_img(self, inputs, width=480, height=480):
|
90 |
images = [load_image(input_) for input_ in inputs]
|
91 |
images = [aspect_ratio_preserving_resize_and_crop(image, target_width=width, target_height=height) for image in images]
|
|
|
92 |
imgs = self.processor([image.convert("RGB") for image in images], return_tensors="pt", size=(width, height)).pixel_values
|
93 |
pixel_values = imgs.to(self.device)
|
94 |
return pixel_values
|