elucideye / acf

Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0 based on https://github.com/pdollar/toolbox
BSD 3-Clause "New" or "Revised" License
49 stars 20 forks source link

terminated with 'std::regex_error' #12

Closed SoonminHwang closed 7 years ago

SoonminHwang commented 7 years ago

Hi, thanks for sharing your work.

I got a problem when I just run the binary 'acf-detect' or 'acf-mat2cpb'.

$ ./acf-detect
terminate called after throwing an instance of 'std::regex_error'
what():  regex_error
Aborted (core dumped)

I just follow your instructions with gcc-4.8 toolchain. Any hint for this?

headupinclouds commented 7 years ago

Hi, thanks for sharing your work.

You're welcome. Bigger thanks to Piotr!

I just follow your instructions with gcc-4.8 toolchain. Any hint for this?

Yes, unfortunately gcc-4.8 provides a std::regex_error stub, but doesn't actually implement it. It should work if you use a newer C++11 standard compliant compiler. FWIW, the std::regex dependency is introduced by the cxxopts command line parser that is used in the console application:

https://github.com/elucideye/acf/blob/1c9fa310e2d743f7b91d44c1b1016e40376eb183/src/app/CMakeLists.txt#L10

So you shouldn't hit the issue if you are using the library itself. If you need to use gcc-4.8 for a CPU console app, there is a more concise unit test illustrating basic setup that could be used as a starting point for a simple app without using cxxopts

https://github.com/elucideye/acf/blob/1c9fa310e2d743f7b91d44c1b1016e40376eb183/src/lib/acf/ut/test-acf.cpp#L317-L336

Let me know if that doesn't work for you.

headupinclouds commented 7 years ago

see: https://stackoverflow.com/a/20027615

SoonminHwang commented 7 years ago

Thanks for quick reply!

I tried to change compiler which supports std:regex such as gcc-4.9 or clang-3.5 & libcxx. But the polly.py seems not to support gcc-4.9. (I cannot find gcc-4-9 in the list when I type polly.py --help)

In the case of libcxx toolchain, I failed to build with some error messages. Here is log file.

Anyway, my first goal is to compare running time to piotr's matlab implementation. I commented cxxopts things in acf.cpp and measure inference time using gettimeofday function.

Even though the inference time of the classifier heavily depends on the image content and casc thershold, somthings are wrong. It takes 54ms for lena512color.png using drishti_face_gray_80x80.cpb. (As you know, ~100ms in piotr's MATLAB code for 640x480 image)

I expect <1ms with my GPU (Titan X Pascal).

I think, I turn on the flag to use GPU. https://github.com/elucideye/acf/blob/17c26894c8d597bb5a33f816167f16d5abe4fe67/CMakeLists.txt#L91

How about the inference time on your machine?