MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / Model

Class Model

examples/Saliency/saliency-maps.py:56–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55
56class Model(tp.ModelDescBase):
57 def inputs(self):
58 return [tf.TensorSpec((IMAGE_SIZE, IMAGE_SIZE, 3), tf.float32, 'image')]
59
60 def build_graph(self, orig_image):
61 mean = tf.get_variable('resnet_v1_50/mean_rgb', shape=[3])
62 with guided_relu():
63 with slim.arg_scope(resnet_v1.resnet_arg_scope()):
64 image = tf.expand_dims(orig_image - mean, 0)
65 logits, _ = resnet_v1.resnet_v1_50(image, 1000, is_training=False)
66 saliency_map(logits, orig_image, name="saliency")
67
68
69def run(model_path, image_path):

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…