Face_recognition: how to use number_of_cpu_cores_to_use parameter?

Created on 31 May 2018  路  2Comments  路  Source: ageitgey/face_recognition

How do i use the "number_of_cpu_cores_to_use" parameter in python? i cant find a single example of using this parameter in your library.
i know the default is 1 but i want to pass -1 so i can make things faster, right now i can see its using only one core in task manager, thanks

Most helpful comment

In file face_recognition_cli.py, line 98. Change it like this.
@click.option('--cpus', default=-1, help='number of CPU cores to use in parallel (can speed up processing lots of images). -1 means "use all in system"')

All 2 comments

number_of_cpu_cores_to_use is a parameter of the command-line tool. If you want to use multiple CPUs in your own code, you have to write your own python code to do it. You can check out the source code of the CLI tool for an example of how to do it in Python.

In file face_recognition_cli.py, line 98. Change it like this.
@click.option('--cpus', default=-1, help='number of CPU cores to use in parallel (can speed up processing lots of images). -1 means "use all in system"')

Was this page helpful?
0 / 5 - 0 ratings