virtual-background icon indicating copy to clipboard operation
virtual-background copied to clipboard

Can 'public/tflite' files be used in other projects? (tflite.wasm, tflite.js)

Open bedcoding opened this issue 2 years ago • 2 comments

Hello, I have a question because there are unfamiliar files in the public/tflite path. (Example: tflite.wasm, tflite.js) If I create a new react project with 'npx create-react-app' command, can I use 'import ... from ...' and use those files as they are?

  • File location: https://github.com/Volcomix/virtual-background/tree/main/public/tflite
  • Related questions: https://community.jitsi.org/t/virtual-background-how-do-i-use-the-tflite-js-file-in-jitsi-open-source/120858

bedcoding avatar Feb 02 '23 04:02 bedcoding

Hi, I haven't found yet how to import the tflite through ES imports. So for now I ended up putting them into the public directory and including it directly as scripts in the HTML file. There is a similar discussion in #16 where you might find some more details.

Volcomix avatar Feb 09 '23 14:02 Volcomix

i get it. I used it like this.

  1. Insert 4 files in public folder.
  2. Call js file in index.html file in public folder.
  3. Use like a global variable. const createTFLiteModule = window.createTFLiteModule; const createTFLiteSIMDModule = window.createTFLiteSIMDModule; https://github.com/jitsi/jitsi-meet/blob/master/react/features/stream-effects/virtual-background/index.js

bedcoding avatar Feb 09 '23 15:02 bedcoding