mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-02-20 16:32:03 +01:00
training.models.vit_resnet50_unet: re-use IMAGE_ORDERING
This commit is contained in:
parent
7888fa5968
commit
4414f7b89b
1 changed files with 8 additions and 12 deletions
|
|
@ -372,12 +372,10 @@ def vit_resnet50_unet(num_patches,
|
||||||
transformer_mlp_head_units = [128, 64]
|
transformer_mlp_head_units = [128, 64]
|
||||||
inputs = Input(shape=(input_height, input_width, 3))
|
inputs = Input(shape=(input_height, input_width, 3))
|
||||||
|
|
||||||
#transformer_units = [
|
if IMAGE_ORDERING == 'channels_last':
|
||||||
#projection_dim * 2,
|
bn_axis = 3
|
||||||
#projection_dim,
|
else:
|
||||||
#] # Size of the transformer layers
|
bn_axis = 1
|
||||||
IMAGE_ORDERING = 'channels_last'
|
|
||||||
bn_axis=3
|
|
||||||
|
|
||||||
x = ZeroPadding2D((3, 3), data_format=IMAGE_ORDERING)(inputs)
|
x = ZeroPadding2D((3, 3), data_format=IMAGE_ORDERING)(inputs)
|
||||||
x = Conv2D(64, (7, 7), data_format=IMAGE_ORDERING, strides=(2, 2),kernel_regularizer=l2(weight_decay), name='conv1')(x)
|
x = Conv2D(64, (7, 7), data_format=IMAGE_ORDERING, strides=(2, 2),kernel_regularizer=l2(weight_decay), name='conv1')(x)
|
||||||
|
|
@ -508,12 +506,10 @@ def vit_resnet50_unet_transformer_before_cnn(num_patches,
|
||||||
transformer_mlp_head_units = [128, 64]
|
transformer_mlp_head_units = [128, 64]
|
||||||
inputs = Input(shape=(input_height, input_width, 3))
|
inputs = Input(shape=(input_height, input_width, 3))
|
||||||
|
|
||||||
##transformer_units = [
|
if IMAGE_ORDERING == 'channels_last':
|
||||||
##projection_dim * 2,
|
bn_axis = 3
|
||||||
##projection_dim,
|
else:
|
||||||
##] # Size of the transformer layers
|
bn_axis = 1
|
||||||
IMAGE_ORDERING = 'channels_last'
|
|
||||||
bn_axis=3
|
|
||||||
|
|
||||||
patches = Patches(transformer_patchsize_x, transformer_patchsize_y)(inputs)
|
patches = Patches(transformer_patchsize_x, transformer_patchsize_y)(inputs)
|
||||||
# Encode patches.
|
# Encode patches.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue