<!DOCTYPE html><html><head><scriptsrc="node_modules/@tensorflow/tfjs/dist/tf.min.js"></script></head><body><imgsrc="0_HELEN_111510095_1_4_0.png"width=112height=112id='img'><script>var ldmks =null;var res =null;var inputTensor =null;asyncfunctionrun(){const imgElement = document.getElementById('img');constIMAGE_SIZE=112;const model =await tf.loadLayersModel('checkpoint_robust_nopose_tfjs/model.json');// console.log(model);for(let i =0; i <10;++i){const startTime1 = performance.now();const img = tf.browser.fromPixels(imgElement).toFloat();const offset = tf.scalar(255.0);// Normalize the image from [0, 255] to [-1, 1].// const normalized = img.sub(offset).div(offset);const normalized = img.div(offset);// Reshape to a single-element batch so we can pass it to predict.const batched = normalized.reshape([1,IMAGE_SIZE,IMAGE_SIZE,3]).transpose([0,3,1,2]);
inputTensor = batched;
console.log(await batched.data());
ldmks =await model.predict(batched);
console.log(await ldmks.data());
console.log(performance.now()- startTime1);
res =await ldmks.data();}};run();</script></body></html>