clancylian / retinaface Goto Github PK
View Code? Open in Web Editor NEWReimplement RetinaFace use C++ and TensorRT
License: MIT License
Reimplement RetinaFace use C++ and TensorRT
License: MIT License
$ mkdir build
$ cd build/
$ cmake ../
cmake的输出:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project: retinaFaceReImp
-- Project Directory: /data/yyh/RetinaFace_c++
-- Build Option: -std=c++11 -O2 -fomit-frame-pointer -g -Wall
-- Found OpenCV: /usr/local (found version "4.1.2")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-10.1 (found version "10.1")
-- Build Option: -DUSE_TENSORRT
-- Build Option: -DUSE_NPP
-- Configuring done
-- Generating done
-- Build files have been written to: /data/yyh/RetinaFace_c++/build
[ 16%] Building NVCC (Device) object CMakeFiles/retinaface.dir/retinaface/retinaface_generated_resizeconvertion.cu.o
/data/yyh/RetinaFace_c++/./retinaface/resizeconvertion.cu(39): error: identifier "printf" is undefined
/data/yyh/RetinaFace_c++/./retinaface/resizeconvertion.cu(97): error: identifier "printf" is undefined
/data/yyh/RetinaFace_c++/./retinaface/resizeconvertion.cu(133): error: identifier "printf" is undefined
3 errors detected in the compilation of "/tmp/tmpxft_0002ba00_00000000-4_resizeconvertion.cpp4.ii".
CMake Error at retinaface_generated_resizeconvertion.cu.o.cmake:266 (message):
Error generating file
/data/yyh/RetinaFace_c++/build/CMakeFiles/retinaface.dir/retinaface/./retinaface_generated_resizeconvertion.cu.o
CMakeFiles/retinaface.dir/build.make:63: recipe for target 'CMakeFiles/retinaface.dir/retinaface/retinaface_generated_resizeconvertion.cu.o' failed
make[2]: *** [CMakeFiles/retinaface.dir/retinaface/retinaface_generated_resizeconvertion.cu.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/retinaface.dir/all' failed
make[1]: *** [CMakeFiles/retinaface.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
none
@clancylian
mobilenet is OK feature have a little not same
res50 model ,the Deconclution shape error
I should know modify the two layer?,
the crop param only inter.
layer {
bottom: "rf_c2_aggr_relu"
top: "rf_c2_upsampling"
name: "rf_c2_upsampling"
type: "Deconvolution"
convolution_param {
num_output: 64
kernel_size: 4
stride: 2
pad: 1
group: 64
bias_term: false
weight_filler: {
type: "bilinear"
}
}
}
layer {
bottom: "rf_c2_upsampling"
bottom: "rf_c1_red_conv_relu"
top: "crop1"
name: "crop1"
type: "Crop"
crop_param {
axis: 1
offset: 0
offset: 0
offset: 0
}
}
Hi,Why the tensorrt model is only 7.6kb and can't detected any face?
and the results of the caffe model are normal。
hi,i got this error, "cudnn_conv_layer.cpp:56] Check failed: error == cudaSuccess (2 vs. 0) out of memory"
,so confused ,how much memory required for the model?(test on gtx1050,4G),
@clancylian Thanks for your great work! Could your share your retrained mxnet model?
is there any way to run this on mobile phone
does any one has dockerfile of this project
我用我自己训练的mxnet模型转换为caffe模型,结构和您提供的mnet-deconv-0517.prototxt有一些不一样。
用我自己的caffe模型转换的时候会报错:
Caffe Parser: Invalid axis in crop layer - only spatial cropping is supported
Hi, thank for your awesome work. I found that image processing with Cuda npp library will accelerate the performance. So could you do the image processing for batch images? thank you
请问是怎样优化的后处理时间呢,这部分代码是在哪个文件中?谢谢
我用这个代码(http://insightface.ai/build/examples_face_detection/demo_retinaface.html, 跑mnet25, 跑出来要80ms左右.
@clancylian Hi, 当我分别 USE_CAFFE 、 USE_TENSORRT测试时,发现两者的时间基本没差,想问下是什么原因呢?非常感谢。
Hi,
just wondering does this project support MacOS system? thank you. BTW, this is a great work!
请问是如何优化的呢
https://ethereon.github.io/netscope/#/editor
Warning
Can't infer network data shapes. Can't infer output shape of the 'face_rpn_cls_score_reshape_stride32' layer of type 'Reshape'. Unsupported layer type: 'Reshape'.
Can you please guide me through this error, Thanks.
CMake Error: Files to be generated by multiple different commands: "path to dir_/build/CMakeFiles/retinaface.dir/retinaface/retinaface_generated_resizeconvertion.cu.o.cmake"
how can i build on windows
Thanks for your sharing. I convert mnet.25 mxnet model to caffe model successfully by your tools, but I find this caffe model can't used in your project directly, so may you pleasure to help me solve it?
getting this error when make
.build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:640: recipe for target '.build_release/examples/mnist/convert_mnist_data.bin' failed make: *** [.build_release/examples/mnist/convert_mnist_data.bin] Error 1 make: *** Waiting for unfinished jobs.... .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/upgrade_net_proto_text.bin' failed make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1 Makefile:635: recipe for target '.build_release/tools/upgrade_solver_proto_text.bin' failed make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/upgrade_net_proto_binary.bin' failed make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/compute_image_mean.bin' failed make: *** [.build_release/tools/compute_image_mean.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/convert_imageset.bin' failed make: *** [.build_release/tools/convert_imageset.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:640: recipe for target '.build_release/examples/siamese/convert_mnist_siamese_data.bin' failed make: *** [.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/extract_features.bin' failed make: *** [.build_release/tools/extract_features.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:635: recipe for target '.build_release/tools/caffe.bin' failed make: *** [.build_release/tools/caffe.bin] Error 1 .build_release/lib/libcaffe.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' .build_release/lib/libcaffe.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:640: recipe for target '.build_release/examples/cifar10/convert_cifar_data.bin' failed make: *** [.build_release/examples/cifar10/convert_cifar_data.bin] Error 1 .build_release/examples/cpp_classification/classification.o: In function `Classifier::Preprocess(cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >*)': classification.cpp:(.text+0x23d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x24d): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0x39d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x3ad): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0x49c): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x4ad): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0x58e): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x66b): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x67c): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0x691): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0x6bc): undefined reference to `cv::split(cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >&)' classification.cpp:(.text+0xa61): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0xab3): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0xac3): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' classification.cpp:(.text+0xb3d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0xb4d): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/examples/cpp_classification/classification.o: In function `Classifier::SetMean(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': classification.cpp:(.text+0x2ce8): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' classification.cpp:(.text+0x2d00): undefined reference to `cv::merge(std::vector<cv::Mat, std::allocator<cv::Mat> > const&, cv::_OutputArray const&)' classification.cpp:(.text+0x2d15): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' .build_release/lib/libcaffe.so: undefined reference to `vtable for cv::_InputArray' collect2: error: ld returned 1 exit status Makefile:640: recipe for target '.build_release/examples/cpp_classification/classification.bin' failed make: *** [.build_release/examples/cpp_classification/classification.bin] Error 1
Please provide some build instructions on Ubuntu 18.04.
您好,我测试了320320的输入,感觉还是比较准确。但是当我将prototxt里输入改成1280896之后,没有出来任何检测结果。请问如何将输入改到1280*896呢?谢谢整理和开源!
您好,阅读您的代码发现在采用 caffe 时,只能进行单张 detect 并且同一时间只能有一个 gpu 工作?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.