Created
September 7, 2018 08:05
-
-
Save zaidalyafeai/0ab2392763352ffbd2ac9184c0938f30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function postprocess(tensor){ | |
return tf.tidy(() => { | |
//normalization factor | |
const scale = tf.scalar(0.5); | |
//unnormalize and sqeeze | |
const squeezed = tensor.squeeze().mul(scale).add(scale) | |
//resize to canvas size | |
const resized = tf.image.resizeBilinear(squeezed, [w, h]) | |
return resized | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment