(x)
| 33 | |
| 34 | |
| 35 | def _heatmap_op(x): |
| 36 | red = x |
| 37 | green = 1.0 - tf.abs(0.5 - x) * 2. |
| 38 | blue = 1. - x |
| 39 | y = tf.stack([red, green, blue]) |
| 40 | y = tf.transpose(y, (1, 2, 0)) |
| 41 | y = tf.cast(y * 255, tf.uint8) |
| 42 | return y |
| 43 | |
| 44 | |
| 45 | image_op = _image_op(IMAGE) |