先说OpenCV,自带的人脸识别及人体识别的xml识别率很差,能把杆子都识别成人体,这也是没谁了。
face++和百度api倒算是好用,但是在检测数量及检测次数上都有很大限制,所以只好不用了。直到在github上发现了openpose,这个实在是很符合我们的需求的,识别率也很高。
进入正题,我先在github上看到了openpose的安装说明,然后开始动手进行安装,安装依赖的过程中一直都很顺利,直到我开始执行 make -j'nproc',结果直接给我报了
/home/rinf/restless/openpose/openpose/3rdparty/caffe/src/caffe/layers/mkldnn_inner_product_layer.cpp: In member function ‘void caffe::MKLDNNInnerProductLayer::InitInnerProductBwd(const std::vector>&, const std::vector&, const std::vector>&)’:
/home/rinf/restless/openpose/openpose/3rdparty/caffe/src/caffe/layers/mkldnn_inner_product_layer.cpp:361:2: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
else
^~~~
/home/sophos/openpose/3rdparty/caffe/src/caffe/layers/mkldnn_inner_product_layer.cpp:365:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
ipBwdData_desc.reset(new inner_product_backward_data::desc(init_bottom_md, init_weights_md, init_top_md));
^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
src/caffe/CMakeFiles/caffe.dir/build.make:1742: recipe for target 'src/caffe/CMakeFiles/caffe.dir/layers/mkldnn_inner_product_layer.cpp.o' failed
这样的错误,被这个错误折腾了好久,终于找到问题如何处理。处理方式如下:
在openpose 目录下找到这个文件3rdparty/caffe/src/caffe/layers/mkldnn_inner_product_layer.cpp,
并在359行至362添加 一对{}即可。
作者:龙萧天
链接:https://www.jianshu.com/p/8d549be41583