MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / upsample2x

Function upsample2x

examples/FasterRCNN/modeling/model_fpn.py:35–47  ·  view source on GitHub ↗
(name, x)

Source from the content-addressed store, hash-verified

33 use_gn = cfg.FPN.NORM == 'GN'
34
35 def upsample2x(name, x):
36 try:
37 resize = tf.compat.v2.image.resize_images
38 with tf.name_scope(name):
39 shp2d = tf.shape(x)[2:]
40 x = tf.transpose(x, [0, 2, 3, 1])
41 x = resize(x, shp2d * 2, 'nearest')
42 x = tf.transpose(x, [0, 3, 1, 2])
43 return x
44 except AttributeError:
45 return FixedUnPooling(
46 name, x, 2, unpool_mat=np.ones((2, 2), dtype='float32'),
47 data_format='channels_first')
48
49 with argscope(Conv2D, data_format='channels_first',
50 activation=tf.identity, use_bias=True,

Callers 1

fpn_modelFunction · 0.85

Calls 3

FixedUnPoolingFunction · 0.90
resizeFunction · 0.85
shapeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…