Thank you. It’s really helpful. Now I can focus on the blocking UI.
I did run the predict/data task on a web worker as following code:
// index.js click to call worker
        tfWorker.postMessage({img: imgBuff}, [imgBuff]);
        tfWorker.onmessage = function (e) {
            let featureBuff = e.data.featureBuff;
        };

// tfWork.js onmessage()
    let imgBuff = e.data.img;
    let inputFloat = new Float32Array(imgBuff);
    let retBuff = await tfWrapper.processImg(inputFloat);    
    postMessage({featureBuff: retBuff.buff}, [retBuff.buff]);   

// tfjs/wrapper.tsx processImg()
    tf.engine().startScope()
    tf.setBackend('webgl');
    let values = this.model.predict();
    let result = await values.array();
    tf.engine().endScope()
    return result;

How can I solve the blocking UI problem(~700ms)?