retinaface wasm
1.0.0
Ini adalah implementasi WASM dari algoritma deteksi wajah Retinaface. Ini didasarkan pada kertas Retinaface.
Modul ini mendukung applet WeChat dan tidak bergantung pada perpustakaan pihak ketiga mana pun dan dapat digunakan secara langsung! (Anda dapat mengompresi file wasm secara manual dengan brotli dan menyalin kode index.ts)
npm install retinaface-wasm
import Retinaface , { getWasmFile , env } from 'retinaface-wasm'
import imagePath from './R.jpg'
const wasm = await WebAssembly . instantiateStreaming ( fetch ( 'https://cdn.jsdelivr.net/npm/retinaface-wasm/wasm/' + getWasmFile ( ) ) , env )
const retinaface = new Retinaface ( wasm . instance )
const image = new Image ( )
image . src = imagePath
await new Promise ( ( resolve , reject ) => {
image . onload = resolve
image . onerror = reject
} )
const [ data , scale ] = retinaface . processImage ( image )
const result = retinaface . detect ( data , scale )
console . log ( result )
retinaface . close ( )
node -e " fs.writeFileSync('retinaface-basic.wasm.br', zlib.brotliCompressSync(fs.readFileSync('retinaface-basic.wasm'))) "
Contoh Program Mini WeChat
478 Contoh Tengara
Indeks Tengara
Shirasawa
MIT