EfficientNetLiteBackbone
类keras_cv.models.EfficientNetLiteBackbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
使用给定的缩放系数实例化 EfficientNetLite 架构。
参考
参数
Rescaling(1/255.0)
层。keras.layers.Input()
的输出),用作模型的图像输入。示例
# Construct an EfficientNetLite from a preset:
efficientnet = models.EfficientNetLiteBackbone.from_preset(
"efficientnetlite_b0"
)
images = np.ones((1, 256, 256, 3))
outputs = efficientnet.predict(images)
# Alternatively, you can also customize the EfficientNetLite architecture:
model = EfficientNetLiteBackbone(
stackwise_kernel_sizes=[3, 3, 5, 3, 5, 5, 3],
stackwise_num_repeats=[1, 2, 2, 3, 3, 4, 1],
stackwise_input_filters=[32, 16, 24, 40, 80, 112, 192],
stackwise_output_filters=[16, 24, 40, 80, 112, 192, 320],
stackwise_expansion_ratios=[1, 6, 6, 6, 6, 6, 6],
stackwise_strides=[1, 2, 2, 2, 1, 2, 1],
width_coefficient=1.0,
depth_coefficient=1.0,
include_rescaling=False,
)
images = np.ones((1, 256, 256, 3))
outputs = model.predict(images)
from_preset
方法EfficientNetLiteBackbone.from_preset()
从预设配置和权重实例化 EfficientNetLiteBackbone 模型。
参数
None
,遵循预设是否提供预训练权重。示例
# Load architecture and weights from preset
model = keras_cv.models.EfficientNetLiteBackbone.from_preset(
"",
)
# Load randomly initialized model from preset architecture with weights
model = keras_cv.models.EfficientNetLiteBackbone.from_preset(
"",
load_weights=False,
预设名称 | 参数 | 描述 |
---|---|---|
efficientnetlite_b0 | 3.41M | 具有 7 个卷积块的 EfficientNet B 风格架构。此 B 风格模型具有 width_coefficient=1.0 和 depth_coefficient=1.0 。 |
efficientnetlite_b1 | 4.19M | 具有 7 个卷积块的 EfficientNet B 风格架构。此 B 风格模型具有 width_coefficient=1.0 和 depth_coefficient=1.1 。 |
efficientnetlite_b2 | 4.87M | 具有 7 个卷积块的 EfficientNet B 风格架构。此 B 风格模型具有 width_coefficient=1.1 和 depth_coefficient=1.2 。 |
efficientnetlite_b3 | 6.99M | 具有 7 个卷积块的 EfficientNet B 风格架构。此 B 风格模型具有 width_coefficient=1.2 和 depth_coefficient=1.4 。 |
efficientnetlite_b4 | 11.84M | 具有 7 个卷积块的 EfficientNet B 风格架构。此 B 风格模型具有 width_coefficient=1.4 和 depth_coefficient=1.8 。 |
EfficientNetLiteB0Backbone
类keras_cv.models.EfficientNetLiteB0Backbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
实例化 EfficientNetLiteB0 架构。
参考
参数
True
,则输入将通过 Rescaling(1/255.0)
层。layers.Input()
的输出),用作模型的图像输入。示例
input_data = np.ones(shape=(8, 224, 224, 3))
# Randomly initialized backbone
model = EfficientNetLiteB0Backbone()
output = model(input_data)
EfficientNetLiteB1Backbone
类keras_cv.models.EfficientNetLiteB1Backbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
实例化 EfficientNetLiteB1 架构。
参考
参数
True
,则输入将通过 Rescaling(1/255.0)
层。layers.Input()
的输出),用作模型的图像输入。示例
input_data = np.ones(shape=(8, 224, 224, 3))
# Randomly initialized backbone
model = EfficientNetLiteB1Backbone()
output = model(input_data)
EfficientNetLiteB2Backbone
类keras_cv.models.EfficientNetLiteB2Backbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
实例化 EfficientNetLiteB2 架构。
参考
参数
True
,则输入将通过 Rescaling(1/255.0)
层。layers.Input()
的输出),用作模型的图像输入。示例
input_data = np.ones(shape=(8, 224, 224, 3))
# Randomly initialized backbone
model = EfficientNetLiteB2Backbone()
output = model(input_data)
EfficientNetLiteB3Backbone
类keras_cv.models.EfficientNetLiteB3Backbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
实例化 EfficientNetLiteB3 架构。
参考
参数
True
,则输入将通过 Rescaling(1/255.0)
层。layers.Input()
的输出),用作模型的图像输入。示例
input_data = np.ones(shape=(8, 224, 224, 3))
# Randomly initialized backbone
model = EfficientNetLiteB3Backbone()
output = model(input_data)
EfficientNetLiteB4Backbone
类keras_cv.models.EfficientNetLiteB4Backbone(
include_rescaling,
width_coefficient,
depth_coefficient,
stackwise_kernel_sizes,
stackwise_num_repeats,
stackwise_input_filters,
stackwise_output_filters,
stackwise_expansion_ratios,
stackwise_strides,
dropout_rate=0.2,
drop_connect_rate=0.2,
depth_divisor=8,
input_shape=(None, None, 3),
input_tensor=None,
activation="relu6",
**kwargs
)
实例化 EfficientNetLiteB4 架构。
参考
参数
True
,则输入将通过 Rescaling(1/255.0)
层。layers.Input()
的输出),用作模型的图像输入。示例
input_data = np.ones(shape=(8, 224, 224, 3))
# Randomly initialized backbone
model = EfficientNetLiteB4Backbone()
output = model(input_data)