@@ -17,20 +17,12 @@ Processor class for Grounding DINO.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
|
||||||
from typing import Dict, List, Optional, Tuple, Union
|
from typing import Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from ...image_processing_utils import BatchFeature
|
from ...image_processing_utils import BatchFeature
|
||||||
from ...image_transforms import center_to_corners_format
|
from ...image_transforms import center_to_corners_format
|
||||||
from ...image_utils import AnnotationFormat, ImageInput
|
from ...image_utils import AnnotationFormat, ImageInput
|
||||||
from ...processing_utils import ImagesKwargs, ProcessingKwargs, ProcessorMixin
|
from ...processing_utils import ImagesKwargs, ProcessingKwargs, ProcessorMixin, Unpack
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
|
||||||
from typing import Unpack
|
|
||||||
else:
|
|
||||||
from typing_extensions import Unpack
|
|
||||||
|
|
||||||
from ...tokenization_utils_base import BatchEncoding, PreTokenizedInput, TextInput
|
from ...tokenization_utils_base import BatchEncoding, PreTokenizedInput, TextInput
|
||||||
from ...utils import TensorType, is_torch_available
|
from ...utils import TensorType, is_torch_available
|
||||||
|
|
||||||
|
|||||||
@@ -16,21 +16,15 @@
|
|||||||
Processor class for Llava.
|
Processor class for Llava.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from ...feature_extraction_utils import BatchFeature
|
from ...feature_extraction_utils import BatchFeature
|
||||||
from ...image_utils import ImageInput, get_image_size, to_numpy_array
|
from ...image_utils import ImageInput, get_image_size, to_numpy_array
|
||||||
from ...processing_utils import ProcessingKwargs, ProcessorMixin, _validate_images_text_input_order
|
from ...processing_utils import ProcessingKwargs, ProcessorMixin, Unpack, _validate_images_text_input_order
|
||||||
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
||||||
from ...utils import logging
|
from ...utils import logging
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
|
||||||
from typing import Unpack
|
|
||||||
else:
|
|
||||||
from typing_extensions import Unpack
|
|
||||||
|
|
||||||
logger = logging.get_logger(__name__)
|
logger = logging.get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,22 +18,12 @@ Processor class for LLaVa-Onevision.
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
from typing import Iterable, List, Union
|
from typing import Iterable, List, Union
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
|
||||||
from typing import Unpack
|
|
||||||
else:
|
|
||||||
from typing_extensions import Unpack
|
|
||||||
|
|
||||||
from ...feature_extraction_utils import BatchFeature
|
from ...feature_extraction_utils import BatchFeature
|
||||||
from ...image_processing_utils import select_best_resolution
|
from ...image_processing_utils import select_best_resolution
|
||||||
from ...image_utils import ImageInput, VideoInput, get_image_size, to_numpy_array
|
from ...image_utils import ImageInput, VideoInput, get_image_size, to_numpy_array
|
||||||
from ...processing_utils import (
|
from ...processing_utils import ProcessingKwargs, ProcessorMixin, Unpack
|
||||||
ProcessingKwargs,
|
|
||||||
ProcessorMixin,
|
|
||||||
)
|
|
||||||
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
||||||
from ...utils import logging
|
from ...utils import logging
|
||||||
from ..auto import AutoImageProcessor
|
from ..auto import AutoImageProcessor
|
||||||
|
|||||||
@@ -16,21 +16,15 @@
|
|||||||
Processor class for Pixtral.
|
Processor class for Pixtral.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from ...feature_extraction_utils import BatchFeature
|
from ...feature_extraction_utils import BatchFeature
|
||||||
from ...image_utils import ImageInput, is_valid_image, load_image
|
from ...image_utils import ImageInput, is_valid_image, load_image
|
||||||
from ...processing_utils import ProcessingKwargs, ProcessorMixin, _validate_images_text_input_order
|
from ...processing_utils import ProcessingKwargs, ProcessorMixin, Unpack, _validate_images_text_input_order
|
||||||
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
||||||
from ...utils import is_torch_device, is_torch_dtype, is_torch_tensor, logging, requires_backends
|
from ...utils import is_torch_device, is_torch_dtype, is_torch_tensor, logging, requires_backends
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
|
||||||
from typing import Unpack
|
|
||||||
else:
|
|
||||||
from typing_extensions import Unpack
|
|
||||||
|
|
||||||
logger = logging.get_logger(__name__)
|
logger = logging.get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,18 +23,9 @@ Processor class for Qwen2-VL.
|
|||||||
|
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Unpack
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Unpack
|
|
||||||
|
|
||||||
from ...feature_extraction_utils import BatchFeature
|
from ...feature_extraction_utils import BatchFeature
|
||||||
from ...image_utils import ImageInput, VideoInput
|
from ...image_utils import ImageInput, VideoInput
|
||||||
from ...processing_utils import (
|
from ...processing_utils import ProcessingKwargs, ProcessorMixin, Unpack
|
||||||
ProcessingKwargs,
|
|
||||||
ProcessorMixin,
|
|
||||||
)
|
|
||||||
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
from ...tokenization_utils_base import PreTokenizedInput, TextInput
|
||||||
from ...utils import logging
|
from ...utils import logging
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import tempfile
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from transformers.models.auto.processing_auto import processor_class_from_name
|
from transformers.models.auto.processing_auto import processor_class_from_name
|
||||||
|
from transformers.processing_utils import Unpack
|
||||||
from transformers.testing_utils import (
|
from transformers.testing_utils import (
|
||||||
check_json_file_has_correct_format,
|
check_json_file_has_correct_format,
|
||||||
require_torch,
|
require_torch,
|
||||||
|
|||||||
Reference in New Issue
Block a user