sygoing / lffd-mnn Goto Github PK
View Code? Open in Web Editor NEWMNN Implementation of the paper of LFFD: A Light and Fast Face Detector for Edge Devices
License: MIT License
MNN Implementation of the paper of LFFD: A Light and Fast Face Detector for Edge Devices
License: MIT License
把mxnet模型转onnx模型前需要Note out(注释掉) the line 57(predict_score = mxnet.symbol.slice_axis(predict_score, axis=1, begin=0, end=1),现在我想用python+tensorrt推理onnx模型,如何得到注释the line 57之前的结果呢?
to run test.cppbut and error output below:
Create interpreter failed, open symbol_10_560_25L_8scales_v1_deploy.mnn/symbol_10_320_20L_5scales_v2_deploy.mnn error
hi, have you plan?
Hello, I probably don't know much about c++. When I compiled test.cpp incorrectly, my command was g++ test.cpp-std=c++ 11 pkg-config -- LIBS -- cflags opencv4
-I. /src. I link MNN libraries and header files at first level
在mac上编译运行成功了,想测试一下使用opencl是否会更快一点,但是编译报错
Undefined symbols for architecture x86_64:
"MNN::Interpreter::releaseModel()", referenced from:
LFFD::~LFFD() in MNN_LFFD.cpp.o
"MNN::Interpreter::resizeTensor(MNN::Tensor*, std::__1::vector<int, std::__1::allocator > const&)", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Interpreter::createSession(MNN::ScheduleConfig const&)", referenced from:
LFFD::LFFD(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, int) in MNN_LFFD.cpp.o
"MNN::Interpreter::resizeSession(MNN::Session*)", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Interpreter::createFromFile(char const*)", referenced from:
LFFD::LFFD(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, int) in MNN_LFFD.cpp.o
"MNN::Interpreter::releaseSession(MNN::Session*)", referenced from:
LFFD::~LFFD() in MNN_LFFD.cpp.o
"MNN::Interpreter::getSessionInput(MNN::Session const*, char const*)", referenced from:
LFFD::LFFD(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, int) in MNN_LFFD.cpp.o
"MNN::Interpreter::getSessionOutput(MNN::Session const*, char const*)", referenced from:
LFFD::LFFD(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, int) in MNN_LFFD.cpp.o
"MNN::Interpreter::~Interpreter()", referenced from:
std::__1::default_deleteMNN::Interpreter::operator()(MNN::Interpreter*) const in MNN_LFFD.cpp.o
"MNN::CV::ImageProcess::create(MNN::CV::ImageProcess::Config const&, MNN::Tensor const*)", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::CV::ImageProcess::convert(unsigned char const*, int, int, int, MNN::Tensor*)", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::CV::ImageProcess::~ImageProcess()", referenced from:
std::__1::default_deleteMNN::CV::ImageProcess::operator()(MNN::CV::ImageProcess*) const in MNN_LFFD.cpp.o
"MNN::Tensor::Tensor(MNN::Tensor const*, MNN::Tensor::DimensionType, bool)", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Tensor::~Tensor()", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Interpreter::runSession(MNN::Session*) const", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Tensor::copyToHostTensor(MNN::Tensor*) const", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
"MNN::Tensor::getDimensionType() const", referenced from:
MNN::Tensor::width() const in MNN_LFFD.cpp.o
MNN::Tensor::height() const in MNN_LFFD.cpp.o
"MNN::Tensor::shape() const", referenced from:
LFFD::detect(cv::Mat&, std::__1::vector<FaceInfo, std::__1::allocator >&, int, int, float, float, int, std::__1::vector<int, std::__1::allocator >) in MNN_LFFD.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2
请问你做了OpenCL或者vulkan后端的测试了吗,能否解答一下疑惑,谢谢
I know is not this repo issue, but how did u guys able to convert to onnx? with original repo, I got some error:
INFO:root:Output node is: conv20_3_bbox
Traceback (most recent call last):
File "to_onnx.py", line 39, in <module>
generate_onnx_file()
File "to_onnx.py", line 29, in generate_onnx_file
onnx_mxnet.export_model(net_symbol, net_params, [input_shape], numpy.float32, onnx_path, verbose=True)
File "/usr/local/lib/python3.5/dist-packages/mxnet/contrib/onnx/mx2onnx/export_model.py", line 87, in export_model
verbose=verbose)
File "/usr/local/lib/python3.5/dist-packages/mxnet/contrib/onnx/mx2onnx/export_onnx.py", line 312, in create_onnx_graph_proto
checker.check_graph(graph)
File "/usr/local/lib/python3.5/dist-packages/onnx/checker.py", line 53, in checker
proto.SerializeToString(), ctx)
onnx.onnx_cpp2py_export.checker.ValidationError: Node (slice_axis20) has input size 1 not in range [min=3, max=5].
==> Context: Bad node spec: input: "softmax0" output: "slice_axis20" name: "slice_axis20" op_type: "Slice" attribute { name: "axes" ints: 1 type: INTS } attribute { name: "ends" ints: 1 type: INTS } attribute { name: "starts" ints: 0 type: INTS }
I am using the every newest version of mxnet and onnx
您好,下载您的源码后,Ubuntu16.04上成功编译了,但进行测试时就报了Segmentation fault (core
sess_lffd = lffd->createSession(config);
就莫名地报错停止了,请教您如何解决这个问题呢?Thank you for your sharing~ Can you give time consumption statistics on pc or mobile?
Thank you very much for your efforts and contributions.
您好,您的源码可以在树莓派上正常编译和运行,不过,推理的时间较长,需要2s多;
如果我想在windows上测试,该如何修改?我修改了cmakelists文件如下:能够编译,但是运行的时候,报错:缺少MNN.dll和opencv_world410d.dll,请教正确的cmakelists文件该如何修改?
另外,我看到您的博客,讲如何在windows平台上编译转换工具,非常详细,但是我按照步骤进行下来报错:
一开始报运行时版本不匹配,我在vs里面修改了运行时以后,编译到99%的时候链接失败。。。
#1.cmake verson
cmake_minimum_required(VERSION 2.8)
#2.project name
project(test C CXX)
#opencv
set(OpenCV_DIR C:/Users/YuKai/Downloads/opencv/opencv/build)
#set(OpenCV_DIR env{OpenCV_DIR})
find_package(OpenCV REQUIRED)
#3.set environment variable
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#4.mnn include
include_directories(${CMAKE_CURRENT_LIST_DIR}/MNN/include)
add_library( MNN SHARED IMPORTED )
set_target_properties(
MNN
PROPERTIES IMPORTED_IMPLIB
${CMAKE_CURRENT_LIST_DIR}/MNN/lib/MNN.lib
)
#6.source directory
file(GLOB TEST_SRC ${CMAKE_CURRENT_LIST_DIR}/src/.h
${CMAKE_CURRENT_LIST_DIR}/src/.cpp)
set(TEST_COMPILE_CODE ${TEST_SRC})
add_executable(test ${TEST_COMPILE_CODE})
target_link_libraries(test
MNN
${OpenCV_LIBS}
)
你好
我参考face detection 的方法转了head detection,得到了onnx和mnn模型
mnn模型检测的时候,没有框输出
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/ffmpeg/lib/libavcodec.57.dylib
Reason: image not found
[1] 19815 abort ./test ../models ../data/demo.jpg
请问这是什么问题
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.