MCPcopy Create free account
hub / github.com/CandleLabAI/PCBSegClassNet / get_edsr_model

Function get_edsr_model

src/models/edsr.py:79–100  ·  view source on GitHub ↗

Get the final model from the given arguments

(num_filters, num_of_residual_blocks)

Source from the content-addressed store, hash-verified

77 return out
78
79def get_edsr_model(num_filters, num_of_residual_blocks):
80 """
81 Get the final model from the given arguments
82 """
83 # Flexible Inputs to input_layer
84 input_layer = layers.Input(shape=(None, None, 3))
85 # Scaling Pixel Values
86 out = layers.Rescaling(scale=1.0 / 255)(input_layer)
87 out = x_new = layers.Conv2D(num_filters, 3, padding="same")(out)
88
89 # 16 residual blocks
90 for _ in range(num_of_residual_blocks):
91 x_new = resblock(x_new)
92
93 x_new = layers.Conv2D(num_filters, 3, padding="same")(x_new)
94 out = layers.Add()([out, x_new])
95
96 out = upsampling(out)
97 out = layers.Conv2D(3, 3, padding="same")(out)
98
99 output_layer = layers.Rescaling(scale=255)(out)
100 return EDSRModel(input_layer, output_layer)

Callers 1

create_mask.pyFile · 0.90

Calls 3

resblockFunction · 0.85
upsamplingFunction · 0.85
EDSRModelClass · 0.85

Tested by

no test coverage detected