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

dlib build arm64 in iPhone6 use frontal_face_detector too slow #1813

Closed linconz closed 5 years ago

linconz commented 5 years ago

Hi,I am using dlib version is 19.17, and use cmake gui tool to generate Xcode project to build dlib static library. On iPhone6 call get_frontal_face_detector this API for face detection is very very slow. Most of the time to detect a picture of 438 * 438 pixels will use 5 seconds.

This is CMake GUI build setting:

屏幕快照 2019-07-02 下午3 13 19

and Xcode build setting made some changes: First, I change base SDK to 'iOS',and Supported Platforms to 'iOS', As well as Valid Architectures to 'arm64 arm64e armv7 armv7s' to adapt to the iOS platform compilation:

屏幕快照 2019-07-02 下午3 19 46

Second, I saw some issues talk about arm64 or cross compile need set '-mfpu=neon' or SSE4 or AVX configure, in my case, I'm setting Other Link Flags like this:

屏幕快照 2019-07-02 下午3 23 05

But,when finish build,in Build log have so many tips:

屏幕快照 2019-07-02 下午3 23 56

It seems not work on Xcode.

In the end,I write some code want to test detect face in image:

- (void)hogFindFaceWithImageName:(NSString *)imageName
{
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:imageName ofType:@"jpg"];
    matrix<rgb_pixel> img;
    load_image(img, [imagePath UTF8String]);

    frontal_face_detector detector = get_frontal_face_detector();

    NSLog(@"detect start");
    std::vector<rectangle> faces = detector(img);
    NSLog(@"detect finish");
    rectangle firstFace = faces[0];
    auto shape = self.sp(img, firstFace);
}

And the print log is:

2019-07-02 15:30:38.138084+0800 TestDlibFaceRecogition[357:36574] detect start
2019-07-02 15:30:43.477129+0800 TestDlibFaceRecogition[357:36574] detect finish

It's very slow, Why?

By the way, picture is Obama: aobama

linconz commented 5 years ago

Please forgive my English is not good

dlib-issue-bot commented 5 years ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-08-16 if there is no further activity.

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

linconz commented 5 years ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-08-16 if there is no further activity.

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

so sad

dlib-issue-bot commented 5 years ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-09-21 if there is no further activity.

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

dlib-issue-bot commented 5 years ago

Warning: this issue has been inactive for 43 days and will be automatically closed on 2019-09-21 if there is no further activity.

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

dlib-issue-bot commented 5 years ago

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