Views
No views yet
pip install -U -q keras-hub
pip install -U -q keras| Preset name | Parameters | Description |
|---|---|---|
resnet_vd_18_imagenet | 11.72M | 18-layer ResNetVD model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
resnet_vd_34_imagenet | 21.84M | 34-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
resnet_vd_50_imagenet | 25.63M | 50-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
resnet_vd_50_ssld_imagenet | 25.63M | 50-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution with knowledge distillation. |
resnet_vd_50_ssld_v2_imagenet | 25.63M | 50-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution with knowledge distillation and AutoAugment. |
resnet_vd_50_ssld_v2_fix_imagenet | 25.63M | 50-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution with knowledge distillation, AutoAugment and additional fine-tuning of the classification head. |
resnet_vd_101_imagenet | 44.67M | 101-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
resnet_vd_101_ssld_imagenet | 44.67M | 101-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution with knowledge distillation. |
resnet_vd_152_imagenet | 60.36M | 152-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
resnet_vd_200_imagenet | 74.93M | 200-layer ResNet model pre-trained on the ImageNet 1k dataset at a 224x224 resolution. |
1
2from keras_hub.models import ResNetBackbone
3import keras
4import numpy as np
5
6input_data = np.ones(shape=(8, 224, 224, 3))
7
8# Pretrained backbone
9model = ResNetBackbone.from_preset("resnet_vd_101_ssld_imagenet")
10output = model(input_data)
11
12# Randomly initialized backbone with a custom config
13model = ResNetBackbone(
14 input_conv_filters=[32, 32, 64],
15 input_conv_kernel_sizes=[3, 3, 3],
16 stackwise_num_filters=[64, 128, 256, 512],
17 stackwise_num_blocks=[3, 4, 5, 6],
18 stackwise_num_strides=[1, 2, 2, 2],
19 block_type="bottleneck_block_vd",
20 )
21output = model(input_data)
221
2from keras_hub.models import ResNetBackbone
3import keras
4import numpy as np
5
6input_data = np.ones(shape=(8, 224, 224, 3))
7
8# Pretrained backbone
9model = ResNetBackbone.from_preset("hf://keras/resnet_vd_101_ssld_imagenet")
10output = model(input_data)
11
12# Randomly initialized backbone with a custom config
13model = ResNetBackbone(
14 input_conv_filters=[32, 32, 64],
15 input_conv_kernel_sizes=[3, 3, 3],
16 stackwise_num_filters=[64, 128, 256, 512],
17 stackwise_num_blocks=[3, 4, 5, 6],
18 stackwise_num_strides=[1, 2, 2, 2],
19 block_type="bottleneck_block_vd",
20 )
21output = model(input_data)
22