TinyYolov2 - load model before inference
See original GitHub issueI am getting this error in production build in React Js and working fine when use npm start.
import * as faceapi from 'face-api.js'
export async function loadModels() {
const MODEL_URL = process.env.PUBLIC_URL + '/models'
await faceapi.loadTinyFaceDetectorModel(MODEL_URL)
await faceapi.loadFaceLandmarkTinyModel(MODEL_URL)
await faceapi.loadFaceRecognitionModel(MODEL_URL)
}
export async function getFullFaceDescription(blob, inputSize = 512) {
const scoreThreshold = 0.5
const OPTION = new faceapi.TinyFaceDetectorOptions({
inputSize,
scoreThreshold
})
const useTinyModel = true
const img = await faceapi.fetchImage(blob)
const fullDesc = await faceapi
.detectAllFaces(img, OPTION)
.withFaceLandmarks(useTinyModel)
.withFaceDescriptors()
}
Please help me on this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Can't Load Models for face-api.js despite infereing the models
I'm getting the error "SsdMobilenetv1 - load model before inference" I'm sending the Front End HTML File from the server. and on the...
Read more >Uncaught (in promise) Error: TinyYolov2 - load model before ...
Uncaught (in promise) Error: TinyYolov2 - load model before inference. i have java script called script.js. Copy Code const video = document.
Read more >Face Recognition using face-api.js / Jirapol Songvuti
Enter index of drawed face 1,2,3,... RuntimeError: FaceDetectionNet - load model before inference. fullFaceDescriptions2 = Error: FaceDetectionNet - load model ...
Read more >[Solved] Faceapi-js cannot load models - CodeProject
The site you are trying to load the scripts from is not configured to allow your site to load the scripts.
Read more >Can't Load Models For Faceapi.Js Despite Infereing The Models
Uncaught in promise Error: TinyYolov2 load model before inference.i have java script called script.js const video document. Tensors are multidimensional arrays ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I saw the same error in a situation where I wasn’t even using the Yolo model, which was confusing.
In the end it was because I had made a coding error, and the models I did want to use weren’t actually loaded. Perhaps there is something in the FaceApiJs code where it throws a wrong error for a missing model, and ends up outputting the last name in the list of nets.
Hey @swapanil , FYI, I solved my problem. I couldn’t load models correctly. Can u check your models location? It should be under the public folder as follows; public/models