Add support for fast image processing in image-pretraining example (#37021)
* Add support for fast image processing in image-pretraining example Fix typo: correct tuple formatting in IMAGE_PROCESSOR_MAPPING_NAMES Signed-off-by: jafraustro <jaime.fraustro.valdez@intel.com> * Use fast image processor by default Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com> Signed-off-by: jafraustro <jaime.fraustro.valdez@intel.com> --------- Signed-off-by: jafraustro <jaime.fraustro.valdez@intel.com> Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
This commit is contained in:
@@ -359,7 +359,7 @@ def main():
|
||||
IMAGE_PROCESSOR_TYPES = {
|
||||
conf.model_type: image_processor_class for conf, image_processor_class in IMAGE_PROCESSOR_MAPPING.items()
|
||||
}
|
||||
image_processor = IMAGE_PROCESSOR_TYPES[model_args.model_type]()
|
||||
image_processor = IMAGE_PROCESSOR_TYPES[model_args.model_type][-1]()
|
||||
|
||||
# create model
|
||||
if model_args.model_name_or_path:
|
||||
|
||||
@@ -56,7 +56,7 @@ else:
|
||||
IMAGE_PROCESSOR_MAPPING_NAMES = OrderedDict(
|
||||
[
|
||||
("align", ("EfficientNetImageProcessor",)),
|
||||
("aria", ("AriaImageProcessor")),
|
||||
("aria", ("AriaImageProcessor",)),
|
||||
("beit", ("BeitImageProcessor",)),
|
||||
("bit", ("BitImageProcessor",)),
|
||||
("blip", ("BlipImageProcessor", "BlipImageProcessorFast")),
|
||||
@@ -142,7 +142,7 @@ else:
|
||||
("shieldgemma2", ("Gemma3ImageProcessor", "Gemma3ImageProcessorFast")),
|
||||
("siglip", ("SiglipImageProcessor", "SiglipImageProcessorFast")),
|
||||
("siglip2", ("Siglip2ImageProcessor", "Siglip2ImageProcessorFast")),
|
||||
("superglue", "SuperGlueImageProcessor"),
|
||||
("superglue", ("SuperGlueImageProcessor",)),
|
||||
("swiftformer", ("ViTImageProcessor", "ViTImageProcessorFast")),
|
||||
("swin", ("ViTImageProcessor", "ViTImageProcessorFast")),
|
||||
("swin2sr", ("Swin2SRImageProcessor",)),
|
||||
|
||||
Reference in New Issue
Block a user