网页 综合 更新时间 2026-11-15 00:14:12

ImageConverter layer

自动蜘蛛 keras.io 正文约 931 字
ImageConverter layer
Preprocess raw images into model ready inputs.
This class converts from raw images to model ready inputs. This conversion proceeds in the following steps:
The layer will take as input a raw image tensor in the channels last or channels first format, and output a preprocessed image input for modeling. This tensor can be batched (rank 4), or unbatched (rank 3).
This layer can be used with the from_preset() constructor to load a layer that will rescale and resize an image for a specific pretrained model. Using the layer this way allows writing preprocessing code that does not need updating when switching between model checkpoints.
Instantiate a keras_hub.layers.ImageConverter from a model preset.
A preset is a directory of configs, weights and other file assets used to save and load a pre-trained model. The preset can be passed as one of:
You can run cls.presets.keys() to list all built-in presets available on the class.
访问原文 返回搜索 https://keras.io/keras_hub/api/preprocessing_layers/image_converter/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。