Upload image_processing_kosmos2.py
Browse files
image_processing_kosmos2.py
CHANGED
@@ -18,14 +18,14 @@ from typing import Dict, List, Optional, Union
|
|
18 |
|
19 |
import numpy as np
|
20 |
|
21 |
-
from
|
22 |
-
from
|
23 |
convert_to_rgb,
|
24 |
get_resize_output_image_size,
|
25 |
resize,
|
26 |
to_channel_dimension_format,
|
27 |
)
|
28 |
-
from
|
29 |
OPENAI_CLIP_MEAN,
|
30 |
OPENAI_CLIP_STD,
|
31 |
ChannelDimension,
|
@@ -36,7 +36,7 @@ from ...image_utils import (
|
|
36 |
to_numpy_array,
|
37 |
valid_images,
|
38 |
)
|
39 |
-
from
|
40 |
|
41 |
|
42 |
logger = logging.get_logger(__name__)
|
|
|
18 |
|
19 |
import numpy as np
|
20 |
|
21 |
+
from transformers.image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
|
22 |
+
from transformers.image_transforms import (
|
23 |
convert_to_rgb,
|
24 |
get_resize_output_image_size,
|
25 |
resize,
|
26 |
to_channel_dimension_format,
|
27 |
)
|
28 |
+
from transformers.image_utils import (
|
29 |
OPENAI_CLIP_MEAN,
|
30 |
OPENAI_CLIP_STD,
|
31 |
ChannelDimension,
|
|
|
36 |
to_numpy_array,
|
37 |
valid_images,
|
38 |
)
|
39 |
+
from transformers.utils import TensorType, is_vision_available, logging
|
40 |
|
41 |
|
42 |
logger = logging.get_logger(__name__)
|