davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.59k stars 3.38k forks source link

When I use CNN to detect face #1437

Closed yyf1986 closed 6 years ago

yyf1986 commented 6 years ago

Ubuntu 16.04 python3.6 dlib 19.15.0 NVIDIA Quadro P4000

import dlib
from skimage import io

detector = dlib.get_frontal_face_detector()

img = io.imread("./023_85.jpg")
dets = detector(img, 1)
print(dets)

when I use normal way to run, it cost 2 second.

import dlib
from skimage import io

detector = dlib.cnn_face_detection_model_v1("./mmod_human_face_detector.dat")

img = io.imread("./023_85.jpg")
dets = detector(img, 1)
print(dets)

when I use CNN to run, it cost 2 minutes.command like CUDA_VISIBLE_DEVICES=0 python3.6 test.py and I find GPU is not use. Why I use CNN is slower than normal?

yyf1986 commented 6 years ago

CUDA 8.0 cuDNN 6.0

AlexXandreE commented 6 years ago

Hi, not really sure what you are asking but _get_frontal_facedetector() is done with HOG classifier which is faster than a neural network without CUDA support. If your problem is in compiling with CUDA then it's recommended the use of cmake, i assure you that using the cmake_gui is easy. Hope this helps.

dlib-issue-bot commented 6 years ago

Warning: this issue has been inactive for 20 days and will be automatically closed on 2018-10-05 if there is no further activity.

If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.

dlib-issue-bot commented 6 years ago

Warning: this issue has been inactive for 27 days and will be automatically closed on 2018-10-05 if there is no further activity.

If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.

dlib-issue-bot commented 6 years ago

Warning: this issue has been inactive for 34 days and will be automatically closed on 2018-10-05 if there is no further activity.

If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.

dlib-issue-bot commented 6 years ago

Notice: this issue has been closed because it has been inactive for 37 days. You may reopen this issue if it has been closed in error.