Closed zul96a closed 3 years ago
How many cpu cores you have? If the number of cpu cores is a lot, then it is very normal to have fast speed with cpu.
import multiprocessing
print(multiprocessing.cpu_count())
Setting CUDA_VISIBLE_DEVICES param to -1 will run it on cpu.
I checked and the machine has 16 cores CPU. Is there any way to increase the speed of face verification drastically while still using Facenet?
You can build FaceNet model once and store in the memory.
model = DeepFace.build_model('Facenet')
Then, use this pre-built model in verification tasks.
DeepFace.verify(selfie_path, MyKad_path, model_name = 'Facenet', model = model, detector_backend = 'mtcnn', distance_metric = 'cosine')
Model building is the most costly stage. In this way, you can build it once and you will not spend time to build it anymore.
Ok thanks! Sir, you really reply very quick. I can't thank you enough!
read me of the repo explains that kind of tricks. I recommend you to read the read-me well.
please do not forget to star the repo :)
Hello! Currently I'm developing a project on Jupyter lab running on a server. At first before this, the notebook uses CPU and return a time of around 7 seconds when verifying one pair of images. But, when I switch to GPU, the running time increases to 11 seconds. I'm not sure which part I'm doing it wrong.
Here are my screenshot of my code and nvidia-smi![image](https://user-images.githubusercontent.com/77947380/110283258-bccd2c80-801a-11eb-99d4-a66e2c1d2628.png)