MCPcopy
hub / github.com/matthewearl/deep-anpr / get_detect_model

Function get_detect_model

model.py:130–153  ·  view source on GitHub ↗

The same as the training model, except it acts on an arbitrarily sized input, and slides the 128x64 window across the image in 8x8 strides. The output is of the form `v`, where `v[i, j]` is equivalent to the output of the training model, for the window at coordinates `(8 * i, 4 * j

()

Source from the content-addressed store, hash-verified

128
129
130def get_detect_model():
131 """
132 The same as the training model, except it acts on an arbitrarily sized
133 input, and slides the 128x64 window across the image in 8x8 strides.
134
135 The output is of the form `v`, where `v[i, j]` is equivalent to the output
136 of the training model, for the window at coordinates `(8 * i, 4 * j)`.
137
138 """
139 x, conv_layer, conv_vars = convolutional_layers()
140
141 # Fourth layer
142 W_fc1 = weight_variable([8 * 32 * 128, 2048])
143 W_conv1 = tf.reshape(W_fc1, [8, 32, 128, 2048])
144 b_fc1 = bias_variable([2048])
145 h_conv1 = tf.nn.relu(conv2d(conv_layer, W_conv1,
146 stride=(1, 1), padding="VALID") + b_fc1)
147 # Fifth layer
148 W_fc2 = weight_variable([2048, 1 + 7 * len(common.CHARS)])
149 W_conv2 = tf.reshape(W_fc2, [1, 1, 2048, 1 + 7 * len(common.CHARS)])
150 b_fc2 = bias_variable([1 + 7 * len(common.CHARS)])
151 h_conv2 = conv2d(h_conv1, W_conv2) + b_fc2
152
153 return (x, h_conv2, conv_vars + [W_fc1, b_fc1, W_fc2, b_fc2])
154

Callers

nothing calls this directly

Calls 4

convolutional_layersFunction · 0.85
weight_variableFunction · 0.85
bias_variableFunction · 0.85
conv2dFunction · 0.85

Tested by

no test coverage detected