ncnn | performance neural network inference framework | Machine Learning library

 by   Tencent C++ Version: 1.0.20240410 License: Non-SPDX

kandi X-RAY | ncnn Summary

kandi X-RAY | ncnn Summary

ncnn is a C++ library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Pytorch, Tensorflow applications. ncnn has no bugs, it has no vulnerabilities and it has medium support. However ncnn has a Non-SPDX License. You can download it from GitHub.

ncnn is a high-performance neural network inference computing framework optimized for mobile platforms. ncnn is deeply considerate about deployment and uses on mobile phones from the beginning of design. ncnn does not have third party dependencies. it is cross-platform, and runs faster than all known open source frameworks on mobile phone cpu. Developers can easily deploy deep learning algorithm models to the mobile platform by using efficient ncnn implementation, create intelligent APPs, and bring the artificial intelligence to your fingertips. ncnn is currently being used in many Tencent applications, such as QQ, Qzone, WeChat, Pitu and so on. ncnn 是一个为手机端极致优化的高性能神经网络前向计算框架。ncnn 从设计之初深刻考虑手机端的部署和使用。无第三方依赖,跨平台,手机端 cpu 的速度快于目前所有已知的开源框架。基于 ncnn,开发者能够将深度学习算法轻松移植到手机端高效执行,开发出人工智能 APP,将 AI 带到你的指尖。ncnn 目前已在腾讯多款应用中使用,如 QQ,Qzone,微信,天天P图等。.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ncnn has a medium active ecosystem.
              It has 17348 star(s) with 3859 fork(s). There are 575 watchers for this library.
              There were 3 major release(s) in the last 6 months.
              There are 954 open issues and 2105 have been closed. On average issues are closed in 161 days. There are 42 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ncnn is 1.0.20240410

            kandi-Quality Quality

              ncnn has 0 bugs and 0 code smells.

            kandi-Security Security

              ncnn has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ncnn code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ncnn has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              ncnn releases are available to install and integrate.
              It has 16722 lines of code, 1143 functions and 387 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ncnn
            Get all kandi verified functions for this library.

            ncnn Key Features

            No Key Features are available at this moment for ncnn.

            ncnn Examples and Code Snippets

            current model load api-Cons
            C++dot img1Lines of Code : 162dot img1License : Non-SPDX (NOASSERTION)
            copy iconCopy
            #if NCNN_STDIO
            int Convolution::load_model(FILE* binfp)
            {
                int nread;
            
                union
                {
                    struct
                    {
                        unsigned char f0;
                        unsigned char f1;
                        unsigned char f2;
                        unsigned char f3;
                    };
                  
            Build for iOS on macOS with xcode
            C++dot img2Lines of Code : 125dot img2License : Non-SPDX (NOASSERTION)
            copy iconCopy
            wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
            tar -xf openmp-11.0.0.src.tar.xz
            cd openmp-11.0.0.src
            
            # apply some compilation fix
            sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_L  
            armv7-mix-assembly-and-intrinsic.md
            C++dot img3Lines of Code : 110dot img3License : Non-SPDX (NOASSERTION)
            copy iconCopy
            // d寄存器全部使用 %P
            // d reg matches %P
            // a += b * c
            float32x2_t _a = vld1_f32(a);
            float32x2_t _b = vld1_f32(b);
            float32x2_t _c = vld1_f32(c);
            asm volatile(
                "vmla.f32  %P0, %P2, %P3"
                : "=w"(_a) // %0
                : "0"(_a),
                  "w"(_b), // %2
                  "w"(  

            Community Discussions

            QUESTION

            Why cv::parallel_for_ run faster than my own implementation?
            Asked 2021-Aug-14 at 11:01

            I am implementing the nearest-neighborhood resizing algorithm for RGB image (unsigned char type). Considering the speed comparison with OpenCV's on Android ARMv8 platform, I find that OpenCV use cv::parallel_for_ for multi-threading speed up.

            Thus, I dive into the corresponding source code of OpenCV's cv::resize(), copy and paste the code that actually run, put in my main.cpp. It contains a functor resizeNNInvoker, and cv::parallel_for_ that performs multi-thread calculation on this functor.

            What makes me confuse is that cv::parallel_for_ version run faster than using my_parallel_for_, whose code keeps same as OpenCV's.

            To make it more clear:

            • Tested on Android armv8 platform
            • **Compiling OpenCV with OpenMP multithread, turn of other parallel framwork
            • Go to OpenCV's cv::parallel_for_, change its source code to the same as my_parallel_for_ (see below)
            • Using 4 threads by cv::setNumThreads(4), and binding 4 big cpu cores (using ncnn API)
            • All code compile under Release mode (via CMake)
            • Test input image: width=7680,height=4320, target image size: 7680/3, 4320/3.

            Time cost is as follow:

            method time cost cv::parallel_for_ 3.24 ms my_parallel_for_ 7.67 ms inplace openmp 7.75 ms ...

            ANSWER

            Answered 2021-Aug-11 at 06:54

            This is the code from OpenCV to select the actual threading framework:

            Source https://stackoverflow.com/questions/68727478

            QUESTION

            Create video from single images
            Asked 2021-May-27 at 15:43

            I have these Images in a folder (~/Downloads/output_frames) I want to use the command I got from https://github.com/nihui/dain-ncnn-vulkan

            ffmpeg -framerate 48 -i output_frames/%06d.png -i audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output.mp4

            I get this error:

            [image2 @ 0x14681b800] Could find no file with path 'output_frames/%06d.png' and index in the range 0-4

            output_frames/%06d.png: No such file or directory

            ...

            ANSWER

            Answered 2021-May-27 at 15:43

            Use %08d.png as there are 8 digits.

            Source https://stackoverflow.com/questions/67724613

            QUESTION

            How can I get the Vulkan API working in Google Colab
            Asked 2020-Oct-13 at 03:26

            I tried running realsr-ncnn-vulkan to just test upscaling a simple image on Google's Colab platform. https://github.com/nihui/realsr-ncnn-vulkan

            The problem is that once I try to run it I'm getting the error

            error while loading shared libraries: libvulkan.so.1: cannot open shared object file: No such file or directory

            So what do I need to install prior before running it? Or is there no way to get vulkan working despite the pretty powerful GPU?

            ...

            ANSWER

            Answered 2020-Oct-10 at 05:03

            You are missing the libraries:

            depending on your setup you need:

            Source https://stackoverflow.com/questions/64267679

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ncnn

            You can download it from GitHub.

            Support

            ✅ = known work and runs fast with good optimization✔️ = known work, but speed may not be fast enough❔ = shall work, not confirmed/ = not applied
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install ncnn

          • CLONE
          • HTTPS

            https://github.com/Tencent/ncnn.git

          • CLI

            gh repo clone Tencent/ncnn

          • sshUrl

            git@github.com:Tencent/ncnn.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link