Open zyqq opened 2 years ago
I preprocess imgData like this
const imgData = {data: new Uint8Array(frame.data), width: frame.width, height: frame.height} return tf.tidy(() => { var tensor = tf.browser.fromPixels(imgData, 1) const resized = tf.image.resizeBilinear(tensor, [28, 28]).toFloat() const offset = tf.scalar(255.0); const normalized = tf.scalar(1.0).sub(resized.div(offset)); const batched = normalized.expandDims(0) return batched }
but it doesn't work right. Did I make a mistake?
I preprocess imgData like this
but it doesn't work right. Did I make a mistake?