question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preloading of the MTCNN model is very slow.

See original GitHub issue

Hello,

I’m using VueJS. When you open a Modal, these codes are working, which I created from your sample code. The value of “console.time” is quite high.

Code:

console.time("fullFaceDescriptions");
vm.yuz_degisken_objesi.fullFaceDescriptions = (await faceapi.allFacesMtcnn(vm.yuz_degisken_objesi.videoEl, vm.yuz_degisken_objesi.mtcnnParams))
    .map(fd => fd.forSize(vm.yuz_degisken_objesi.hw.width, vm.yuz_degisken_objesi.hw.height));
console.timeEnd("fullFaceDescriptions");
console.log("*");

fullFaceDescriptions: 5500.3720703125ms * fullFaceDescriptions: 372.788818359375ms * fullFaceDescriptions: 257.229736328125ms * fullFaceDescriptions: 180.324951171875ms * fullFaceDescriptions: 222.89404296875ms * fullFaceDescriptions: 207.50927734375ms *

How can I make it more stable?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
justadudewhohackscommented, Oct 15, 2018

Before you are putting too much work into this, I will soon publish some new changes, including a new tiny face detector, which is much faster than ssd and mtcnn and produces much more stable detection results than mtcnn.

I think at that point there will be no real reason anymore to use the mtcnn, unless there is a way to fix the warmup issue.

2reactions
justadudewhohackscommented, Sep 13, 2018

Nothing really that I know of, seems like the first time a tensor of a certain shape is uploaded to the GPU there is an initial delay, which they refer to as “warmup” in the mobilenet example. The MTCNN uploads tensors of N + 2 different shapes (N in stage 1, can be adjusted by the maxNumScales forward parameter and 1 each in stages 2 and 3). This unfortunately causes the first forward pass of MTCNN to be much longer on certain machines.

I am not sure where this inital delay comes from (maybe due to allocating textures of certain sizes on the GPU, just a wild guess, I am not that familar with WebGL for GPGPU). If it concerns you, maybe you could ask at tfjs for help.

PS: I would also be interested in the answer to that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GPUs Are Fast! Datasets Are Your Bottleneck | by William Falcon
This means that they are super slow. If your models allows you to, you could apply the same transforms to a batch of...
Read more >
Edge Deployment Framework of GuardBot for Optimized Face ...
Our framework contains dual-stage architecture based on convolutional neural networks with three main modules that employ (1) MTCNN for face ...
Read more >
MTCNN Face Detection Implementation for TensorFlow, As A ...
The model is adapted from the Facenet's MTCNN implementation, merged in a single file located inside the folder 'data' relative to the module's...
Read more >
Fast MTCNN detector (~55 FPS at full resolution) - Kaggle
This notebook demonstrates how to achieve 45 frames per second speeds for loading frames and detecting faces on full resolution videos. Algorithm¶. Striding: ......
Read more >
Computer Vision: 'seeing' people on a bus | Medium - Medium
A python implement of mtcnn by Ivan which I used can be found here. ... into a much denser and more robust network...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found