为什么dlib这么慢找到对象? [英] Why is dlib so slow finding an object?

查看:165
本文介绍了为什么dlib这么慢找到对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Dlib测试某些东西,并使用tools/imglab/build/imglab中包含的编译工具在要识别的对象实例周围选择矩形.有了这个xml文件,它描述了我要检测的对象的几种不同视图,我运行了火车对象预测变量,但做了一些更改:

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")

并在images目录中运行,创建了detector.svm.

and running in the images directory, makes a detector.svm.

现在,我为图像运行一个改进的对象检测器,它检测到许多应该检测到的对象,并在它们周围放置一个矩形,但是在1920x1080的屏幕快照中找到它们大约需要2秒钟!这是在2.60GHz×4的i5-3230M CPU上执行的,因此我想知道是否缺少压缩或其他步骤才能使它运行得更快或在功能较弱的设备上运行.如果需要的话,它是从dlib-18.16在Ubuntu上编译的.

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.

推荐答案

我在类似情况下使用Dlib的对象检测器,并且在1920x1080分辨率下使用类似的处理器可以达到20 fps

I am using Dlib's object detector for similar situation and I have 20 fps on 1920x1080 relotion with the similar processor

首先-从github获取最新版本之后,请确保已启用AVX支持( -mavx ),并且正在编译优化的代码( -O3或-Ofast )

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)

如我所见-您正在将Python接口用于Dlib.要编译它,您应该调用:

As I see - you are using Python interface for Dlib. To compile it, you should call :

python setup.py install-是USE_AVX_INSTRUCTIONS

python setup.py install --yes USE_AVX_INSTRUCTIONS

(遵循dlib文件夹中的readme.txt指令)

(follow readme.txt instruction in dlib's folder)

这篇关于为什么dlib这么慢找到对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆