predict = (imgElement) => tf.tidy(() => {
const raw = tf.fromPixels(imgElement).toFloat();
const cropped = cropImage(raw);
const resized = tf.image.resizeBilinear(cropped, [IMAGE_SIZE, IMAGE_SIZE])
const offset = tf.scalar(127);
const normalized = resized.sub(offset).div(offset);
const batched = normalized.expandDims(0);
return mobilenet.predict(batched).dataSync();
})