Skip to Content
Mastering Computer Vision with TensorFlow 2.x
book

Mastering Computer Vision with TensorFlow 2.x

by Krishnendu Kar
May 2020
Beginner to intermediate
430 pages
10h 39m
English
Packt Publishing
Content preview from Mastering Computer Vision with TensorFlow 2.x

Connect left to right

If you look at the image provided at the beginning of the Coding an hourglass model section, you will notice that the left and right blocks are connected by the connect_left_to_right block. The code that's used to connect the left block to the right block is as follows:

def connect_left_to_right(left, right, bottleneck, name, num_channels):''':param left: connect left feature to right feature:param name: layer name:return:'''_xleft = bottleneck(left, num_channels, name + '_connect')_xright = UpSampling2D()(right)add = Add()([_xleft, _xright])out = bottleneck(add, num_channels, name + '_connect_conv')return out

Note that each right block is generated by upsampling and is added to the left block to generate the final output. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Computer Vision with TensorFlow 2

Hands-On Computer Vision with TensorFlow 2

Benjamin Planche, Eliot Andres

Publisher Resources

ISBN: 9781838827069Supplemental Content