Tuesday, August 4, 2020

landmark CNN

1. Output size

This model generate 68 landmarks and coordinate of the landmarks are 2D. (x,y)
so output size will be 68 * 2 = 136

self.dense_2 = keras.layers.Dense(units=self.output_size,
                                        activation=None,
                                        use_bias=True)

2. Layers

self.conv_1 = keras.layers.Conv2D(filters=32,
                                kernel_size=(3, 3),
                                activation='relu')
self.conv_2 = keras.layers.Conv2D(filters=64,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')
self.conv_3 = keras.layers.Conv2D(filters=64,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                padding='valid',
                                activation=tf.nn.relu)
self.conv_4 = keras.layers.Conv2D(filters=64,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')
self.conv_5 = keras.layers.Conv2D(filters=64,
                                kernel_size=[3, 3],
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')
self.conv_6 = keras.layers.Conv2D(filters=128,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')
self.conv_7 = keras.layers.Conv2D(filters=128,
                                kernel_size=[3, 3],
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')
self.conv_8 = keras.layers.Conv2D(filters=256,
                                kernel_size=[3, 3],
                                strides=(1, 1),
                                padding='valid',
                                activation='relu')

Generally when we construct CNN networks, first parameter of Conv2D function is the count of filters. Don't be confused with the size of the images. size of the images will be reduced by polling layers not conv layers. Like above layers, filters will be 32 -> 64 -> 128 -> 256 at the end all of the filters are going to be connected with Dense layer and use flatten function.

3. Input shape.
I used (128, 128, 3) shape. (Height, Width, Channel)

4. Who call the call() function in the keras's Model.
When we call build() function, it will call the call() function and pass the input shape. after this we can use summary() function.

Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw