mtcnn icon indicating copy to clipboard operation
mtcnn copied to clipboard

use model() instead of model.predict()

Open simone1999 opened this issue 5 years ago • 0 comments

when using model.predict() on small batches it is verry slow. Alternatively you can call the model directly with the training=False flag which is way faster. the predict method does assemble batches and other things. since you are calling the model for every frame seperately batching does not give you anny advantag. calling it directly gives you back a tensor, so you need to convert them into numpy arrays with .numpy() makes your model quite a bit faster for no harm!

simone1999 avatar Feb 03 '21 15:02 simone1999