问题
I'm testing some stuff with Dlib and I selected rectangles around instances of an object I want to recognize, using the compiled tool included in tools/imglab/build/imglab. With this xml file describing a few different views of the object I want to detect I run the train object predictor with a few changes:
training_xml_path = os.path.join(faces_folder, "cooldataset.xml")
testing_xml_path = os.path.join(faces_folder, "cooldataset.xml")
and running in the images directory, makes a detector.svm.
Now I run a modified object detector for an image, it detects many of the objects it should and puts a rectangle around them, yet it takes almost 2 seconds to find them in a 1920x1080 screenshot! This is on a i5-3230M CPU @ 2.60GHz × 4 so I wonder if there is some compression or other step that I'm missing to make it go faster or work on less powerful device. This is compiled on Ubuntu from dlib-18.16 if that matters.
回答1:
I am using Dlib's object detector for similar situation and I have 20 fps on 1920x1080 relotion with the similar processor
First of all - get latest version from github After that ensure that you have AVX support enabled (-mavx) and you are compiling optimized code (-O3 or -Ofast)
As I see - you are using Python interface for Dlib. To compile it, you should call :
python setup.py install --yes USE_AVX_INSTRUCTIONS
(follow readme.txt instruction in dlib's folder)
来源:https://stackoverflow.com/questions/36683997/why-is-dlib-so-slow-finding-an-object