3 ms·
So seemingly this is a Tensorflow model compiled as WASM? Pretty cool no matter how it's accomplished but I'll echo the other commenter that a more detailed wri
by methodin 5y ago
So seemingly this is a Tensorflow model compiled as WASM? Pretty cool no matter how it's accomplished but I'll echo the other commenter that a more detailed writeup would be nice especially for the HN folks!
- pwdisswordfish9 5y agoYeah, really. What's with the claim about "pure JS"...? async function setup() { await faceapi.tf.setWasmPaths('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.12.0/dist/'); await faceapi.tf.setBackend('wasm'); await faceapi.tf.enableProdMode(); await faceapi.tf.ENV.set('DEBUG', false); await faceapi.tf.ready(); const model = await set_and_get_filter('gigachad'); await faceapi.nets.tinyFaceDetector.load('./faceapi-models'); };
- sillysaurusx 5y agoThere's not a whole lot of difference between minified JS and WASM anyway.
- tluyben2 5y agoSure but a from scratch implementation in pure JS instead of a wasm compile would be cool.
- capableweb 5y agoHow.. Wai... What do you mean? There is a lot of difference! That's like saying Java bytecode is the same as Java source code, not nearly the same thing! Things that can run JS can run minified JS but doesn't mean it can run WASM, and just because something can run WASM doesn't mean it can run JS.
- int_19h 5y agoIf something can run wasm, it can run JS by running an interpreter compiled to wasm. Conversely, wasm can be transpiled to JS, and asm.js is also a thing.
- capableweb 5y agoSeems it's just the HN title that is incorrect, the website itself makes no claim about being vanilla JS/"pure" JS. Maybe mods/dang can correct it to remove the "Pure JavaScript" part?
- gitgud 5y agoI think a better description would be "pure client-side"