Browse Source

Merge branch 'feature/support-64plus-cpu' of https://github.com/yok7/ncnn into feature/support-64plus-cpu

pull/6185/head
KRT 11 months ago
parent
commit
991fca81ed
100 changed files with 716 additions and 1319 deletions
  1. +1
    -1
      .github/workflows/code-format.yml
  2. +18
    -8
      .github/workflows/linux-riscv64.yml
  3. +8
    -0
      .github/workflows/test-coverage.yml
  4. +62
    -0
      .github/workflows/windows-xp-clang.yml
  5. +57
    -0
      .github/workflows/windows-xp-mingw.yml
  6. +56
    -0
      .github/workflows/windows-xp-msvc.yml
  7. +4
    -4
      LICENSE.txt
  8. +2
    -13
      benchmark/RankCards/Rcards.h
  9. +2
    -13
      benchmark/RankCards/main.cpp
  10. +10
    -13
      benchmark/benchncnn.cpp
  11. +8
    -0
      cmake/ncnnConfig.cmake.in
  12. +137
    -0
      docs/developer-guide/build-ncnn-on-windows-xp.zh.md
  13. +2
    -77
      docs/developer-guide/glsl-extension.md
  14. +99
    -83
      docs/developer-guide/glsl-extension.zh.md
  15. +76
    -1
      docs/how-to-build/how-to-build.md
  16. +2
    -13
      examples/fasterrcnn.cpp
  17. +2
    -13
      examples/mobilenetssd.cpp
  18. +2
    -13
      examples/mobilenetv2ssdlite.cpp
  19. +2
    -13
      examples/mobilenetv3ssdlite.cpp
  20. +2
    -13
      examples/nanodet.cpp
  21. +2
    -13
      examples/nanodetplus_pnnx.cpp
  22. +2
    -13
      examples/p2pnet.cpp
  23. +2
    -13
      examples/peleenetssd_seg.cpp
  24. +2
    -13
      examples/ppocrv5.cpp
  25. +2
    -13
      examples/ppocrv5_dict.h
  26. +2
    -13
      examples/retinaface.cpp
  27. +2
    -13
      examples/rfcn.cpp
  28. +2
    -13
      examples/rvm.cpp
  29. +2
    -13
      examples/scrfd.cpp
  30. +2
    -13
      examples/scrfd_crowdhuman.cpp
  31. +2
    -13
      examples/shufflenetv2.cpp
  32. +2
    -13
      examples/simplepose.cpp
  33. +2
    -13
      examples/squeezenet.cpp
  34. +2
    -13
      examples/squeezenet_c_api.cpp
  35. +2
    -13
      examples/squeezenetssd.cpp
  36. +2
    -13
      examples/yolact.cpp
  37. +2
    -13
      examples/yolo11.cpp
  38. +2
    -13
      examples/yolo11_cls.cpp
  39. +2
    -13
      examples/yolo11_obb.cpp
  40. +2
    -13
      examples/yolo11_pose.cpp
  41. +2
    -13
      examples/yolo11_seg.cpp
  42. +2
    -13
      examples/yolov2.cpp
  43. +2
    -13
      examples/yolov3.cpp
  44. +2
    -13
      examples/yolov4.cpp
  45. +2
    -13
      examples/yolov5.cpp
  46. +2
    -13
      examples/yolov5_pnnx.cpp
  47. +2
    -13
      examples/yolov7.cpp
  48. +2
    -13
      examples/yolov7_pnnx.cpp
  49. +2
    -13
      examples/yolov8.cpp
  50. +2
    -13
      examples/yolov8_cls.cpp
  51. +2
    -13
      examples/yolov8_obb.cpp
  52. +2
    -13
      examples/yolov8_pose.cpp
  53. +2
    -13
      examples/yolov8_seg.cpp
  54. +2
    -13
      examples/yoloworld.cpp
  55. +3
    -14
      examples/yolox.cpp
  56. +2
    -13
      python/examples/fasterrcnn.py
  57. +2
    -13
      python/examples/mobilenetssd.py
  58. +2
    -13
      python/examples/mobilenetv2ssdlite.py
  59. +2
    -13
      python/examples/mobilenetv3ssdlite.py
  60. +2
    -13
      python/examples/model_zoo.py
  61. +2
    -13
      python/examples/nanodet.py
  62. +2
    -13
      python/examples/peleenetssd.py
  63. +2
    -13
      python/examples/retinaface.py
  64. +2
    -13
      python/examples/rfcn.py
  65. +2
    -13
      python/examples/shufflenetv2.py
  66. +2
    -13
      python/examples/simplepose.py
  67. +2
    -13
      python/examples/squeezenet.py
  68. +2
    -13
      python/examples/squeezenetssd.py
  69. +2
    -13
      python/examples/yolact.py
  70. +2
    -13
      python/examples/yolov2.py
  71. +2
    -13
      python/examples/yolov3.py
  72. +2
    -13
      python/examples/yolov4.py
  73. +2
    -13
      python/examples/yolov5.py
  74. +2
    -13
      python/examples/yolov8.py
  75. +2
    -13
      python/ncnn/__init__.py
  76. +2
    -13
      python/ncnn/model_zoo/__init__.py
  77. +2
    -13
      python/ncnn/model_zoo/fasterrcnn.py
  78. +2
    -13
      python/ncnn/model_zoo/mobilenetssd.py
  79. +2
    -13
      python/ncnn/model_zoo/mobilenetv2ssdlite.py
  80. +2
    -13
      python/ncnn/model_zoo/mobilenetv3ssdlite.py
  81. +2
    -13
      python/ncnn/model_zoo/model_store.py
  82. +2
    -13
      python/ncnn/model_zoo/model_zoo.py
  83. +2
    -13
      python/ncnn/model_zoo/nanodet.py
  84. +2
    -13
      python/ncnn/model_zoo/peleenetssd.py
  85. +2
    -13
      python/ncnn/model_zoo/retinaface.py
  86. +2
    -13
      python/ncnn/model_zoo/rfcn.py
  87. +2
    -13
      python/ncnn/model_zoo/shufflenetv2.py
  88. +2
    -13
      python/ncnn/model_zoo/simplepose.py
  89. +2
    -13
      python/ncnn/model_zoo/squeezenet.py
  90. +2
    -13
      python/ncnn/model_zoo/squeezenetssd.py
  91. +2
    -13
      python/ncnn/model_zoo/yolact.py
  92. +2
    -13
      python/ncnn/model_zoo/yolov2.py
  93. +2
    -13
      python/ncnn/model_zoo/yolov3.py
  94. +2
    -13
      python/ncnn/model_zoo/yolov4.py
  95. +2
    -13
      python/ncnn/model_zoo/yolov5.py
  96. +5
    -13
      python/ncnn/model_zoo/yolov7.py
  97. +2
    -13
      python/ncnn/model_zoo/yolov8.py
  98. +2
    -13
      python/ncnn/utils/__init__.py
  99. +2
    -13
      python/ncnn/utils/download.py
  100. +2
    -13
      python/ncnn/utils/functional.py

+ 1
- 1
.github/workflows/code-format.yml View File

@@ -56,7 +56,7 @@ jobs:
- name: configure-git-safe-directory
run: git config --global --add safe.directory /__w/ncnn/ncnn

- uses: stefanzweifel/git-auto-commit-action@v5
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: apply code-format changes



+ 18
- 8
.github/workflows/linux-riscv64.yml View File

@@ -133,14 +133,15 @@ jobs:
fail-fast: false
matrix:
include:
- { cpu: x60, QEMU_CPU: rv64, OPENMP: ON, RVV: ON, XTHEADVECTOR: OFF, ZFH: ON, ZVFH: ON }
- { cpu: x60, QEMU_CPU: "max,vlen=256,elen=64,vext_spec=v1.0", OPENMP: ON, RVV: ON, XTHEADVECTOR: OFF, ZFH: ON, ZVFH: ON }

steps:
- uses: actions/checkout@v4

# https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v1.1.2.tar.xz
- name: build-gcc
run: |
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.0.5
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.1.2
mkdir build-gcc && cd build-gcc
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/k1.toolchain.cmake -DCMAKE_BUILD_TYPE=release \
-DNCNN_OPENMP=${{ matrix.OPENMP }} -DNCNN_THREADS=${{ matrix.OPENMP }} \
@@ -154,7 +155,7 @@ jobs:

- name: build-llvm
run: |
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.0.5
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.1.2
mkdir build-llvm && cd build-llvm
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/k1.llvm.toolchain.cmake -DCMAKE_BUILD_TYPE=release \
-DNCNN_OPENMP=${{ matrix.OPENMP }} -DNCNN_THREADS=${{ matrix.OPENMP }} \
@@ -166,11 +167,20 @@ jobs:
-DNCNN_SIMPLEOCV=ON -DNCNN_BUILD_EXAMPLES=ON -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 8

# - name: test-gcc
# run: |
# export PATH=/data/action/osd/spacemit-ai-sdk.v1.1.0/spacemit-qemu/bin:$PATH
# cd build-gcc
# TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;${{ matrix.QEMU_CPU }}" ctest --output-on-failure -j 8
# https://archive.spacemit.com/spacemit-ai/qemu/jdsk-qemu-v0.0.14.tar.gz
- name: test-gcc
run: |
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.1.2
export PATH=/data/action/osd/jdsk-qemu/bin:$PATH
cd build-gcc
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;${{ matrix.QEMU_CPU }};-L;${RISCV_ROOT_PATH}/sysroot" ctest --output-on-failure -j 8

- name: test-llvm
run: |
export RISCV_ROOT_PATH=/data/action/osd/spacemit-toolchain-linux-glibc-x86_64-v1.1.2
export PATH=/data/action/osd/jdsk-qemu/bin:$PATH
cd build-llvm
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;${{ matrix.QEMU_CPU }};-L;${RISCV_ROOT_PATH}/sysroot" ctest --output-on-failure -j 8

gcc-rvv:
runs-on: [self-hosted, linux, ubuntu]


+ 8
- 0
.github/workflows/test-coverage.yml View File

@@ -59,6 +59,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/.local/bin/codecov
files: build/lcov.info

linux-gcc-x64:
@@ -140,6 +141,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info,build-openmp/lcov.info

linux-gcc-x64-simplestl-simplemath:
@@ -171,6 +173,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info

linux-gcc-x64-sde:
@@ -222,6 +225,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info

linux-gcc-x64-sde-combined:
@@ -281,6 +285,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info

linux-gcc-riscv64-rvv:
@@ -356,6 +361,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info

linux-gpu-swiftshader:
@@ -413,6 +419,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info

linux-gcc-cross:
@@ -571,4 +578,5 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
plugins: noop
binary: /data/action/osd/codecov
files: build/lcov.info,build-openmp/lcov.info

+ 62
- 0
.github/workflows/windows-xp-clang.yml View File

@@ -0,0 +1,62 @@
name: windows-xp-clang
on:
push:
branches: [master]
paths:
- '.github/workflows/windows-xp-clang.yml'
- 'toolchains/windows-xp-clang.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/windows-xp-clang.yml'
- 'toolchains/windows-xp-clang.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
concurrency:
group: windows-xp-clang-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read

jobs:
windows:
name: Clang
runs-on: windows-2022

env:
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Clang
run: choco install llvm --version=6.0.0 --allow-downgrade
- name: Verify Clang
run: |
clang --version
clang++ --version
- name: config
run: |
Invoke-WebRequest -Uri https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z -OutFile i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
7z x ./i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
Add-Content -Path $env:GITHUB_ENV -Value "MINGW32_ROOT_PATH=${{ github.workspace }}\mingw32"
echo "${{ github.workspace }}\mingw32\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-clang.toolchain.cmake" -DNCNN_SIMPLEOCV=ON -DNCNN_SIMPLEOMP=ON -DNCNN_AVX2=OFF -DNCNN_AVX=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4

+ 57
- 0
.github/workflows/windows-xp-mingw.yml View File

@@ -0,0 +1,57 @@
name: windows-xp-mingw
on:
push:
branches: [master]
paths:
- '.github/workflows/windows-xp-mingw.yml'
- 'toolchains/windows-xp-mingw.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/windows-xp-mingw.yml'
- 'toolchains/windows-xp-mingw.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
concurrency:
group: windows-xp-mingw-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read

jobs:
windows:
name: MinGW-w32
runs-on: windows-2022

env:
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: config
run: |
Invoke-WebRequest -Uri https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z -OutFile i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
7z x ./i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
Add-Content -Path $env:GITHUB_ENV -Value "MINGW32_ROOT_PATH=${{ github.workspace }}\mingw32"
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}\mingw32\bin"
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-mingw.toolchain.cmake" -DNCNN_SIMPLEOCV=ON -DNCNN_AVX2=OFF -DNCNN_AVX=OFF -DNCNN_VULKAN=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4

+ 56
- 0
.github/workflows/windows-xp-msvc.yml View File

@@ -0,0 +1,56 @@
name: windows-xp-msvc
on:
push:
branches: [master]
paths:
- '.github/workflows/windows-xp-msvc.yml'
- 'toolchains/windows-xp-msvc.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/windows-xp-msvc.yml'
- 'toolchains/windows-xp-msvc.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'tests/**'
concurrency:
group: windows-xp-msvc-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read

jobs:
windows:
name: MSVC
runs-on: windows-2022

env:
VS_INSTALL_DIR: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
UseMultiToolTask: true
NCNN_CMAKE_OPTIONS: -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: config
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" modify --installPath "${{ env.VS_INSTALL_DIR }}" --channelId VisualStudio.17.Release --add Microsoft.VisualStudio.Component.WinXP --add Microsoft.VisualStudio.Component.VC.Tools.X86.X64.Spectre --add Microsoft.VisualStudio.Component.VC.Tools.X86.X64 --add Microsoft.VisualStudio.Component.VC.Tools.X86.X64 --add Microsoft.VisualStudio.Component.VC.v141.xp --nocache --quiet
call "${{ env.VS_INSTALL_DIR }}\VC\Auxiliary\Build\vcvarsall.bat" x86
- name: build
run: |
mkdir build; cd build
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -A WIN32 -G "Visual Studio 17 2022" -T v141_xp -DNCNN_SIMPLEOCV=ON -DNCNN_OPENMP=OFF -DNCNN_BUILD_WITH_STATIC_CRT=ON -DNCNN_AVX2=OFF -DNCNN_AVX=OFF -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-msvc.toolchain.cmake" ..
cmake --build . --config Release -j 4
- name: test
run: cd build; ctest -C Release --output-on-failure -j 4

+ 4
- 4
LICENSE.txt View File

@@ -1,5 +1,5 @@
Tencent is pleased to support the open source community by making ncnn available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Copyright (C) 2017 Tencent. All rights reserved.
If you have downloaded a copy of the ncnn binary from Tencent, please note that the ncnn binary is licensed under the BSD 3-Clause License.
If you have downloaded a copy of the ncnn source code from Tencent, please note that ncnn source code is licensed under the BSD 3-Clause License, except for the third-party components listed below which are subject to different license terms. Your integration of ncnn into your own projects may require compliance with the BSD 3-Clause License, as well as the other licenses applicable to the third-party components included within ncnn.
A copy of the BSD 3-Clause License is included in this file.
@@ -7,7 +7,7 @@ A copy of the BSD 3-Clause License is included in this file.
Other dependencies and licenses:

Open Source Software Licensed Under the zlib License:
The below software in this distribution may have been modified by THL A29 Limited (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 THL A29 Limited.
The below software in this distribution may have been modified by Tencent (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 Tencent.
----------------------------------------------------------------------------------------
1. neon_mathfun.h
Copyright (C) 2011 Julien Pommier
@@ -38,7 +38,7 @@ Permission is granted to anyone to use this software for any purpose, including


Open Source Software Licensed Under the BSD 2-Clause License:
The below software in this distribution may have been modified by THL A29 Limited (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 THL A29 Limited.
The below software in this distribution may have been modified by Tencent (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 Tencent.
----------------------------------------------------------------------------------------
1. squeezenet 1.1
Copyright (c) 2016 Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer
@@ -66,7 +66,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND


Open Source Software Licensed Under the BSD 3-Clause License:
The below software in this distribution may have been modified by THL A29 Limited (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 THL A29 Limited.
The below software in this distribution may have been modified by Tencent (“Tencent Modifications”). All Tencent Modifications are Copyright (C) 2017 Tencent.
----------------------------------------------------------------------------------------
1. android.toolchain.cmake master
Copyright (c) 2010-2011, Ethan Rublee


+ 2
- 13
benchmark/RankCards/Rcards.h View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause
#ifndef RCARDS_H
#define RCARDS_H



+ 2
- 13
benchmark/RankCards/main.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include <iostream>
#include <iostream>


+ 10
- 13
benchmark/benchncnn.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include <float.h>
#include <stdio.h>
@@ -59,6 +48,14 @@ static ncnn::VkAllocator* g_staging_vkallocator = 0;

void benchmark(const char* comment, const std::vector<ncnn::Mat>& _in, const ncnn::Option& opt, bool fixed_path = true)
{
// Skip if int8 model name and using GPU
if (opt.use_vulkan_compute && strstr(comment, "int8") != NULL)
{
if (!fixed_path)
fprintf(stderr, "%20s skipped (int8+GPU not supported)\n", comment);
return;
}

g_blob_pool_allocator.clear();
g_workspace_pool_allocator.clear();



+ 8
- 0
cmake/ncnnConfig.cmake.in View File

@@ -1,3 +1,4 @@
set(NCNN_VERSION @NCNN_VERSION@)
set(NCNN_OPENMP @NCNN_OPENMP@)
set(NCNN_THREADS @NCNN_THREADS@)
set(NCNN_VULKAN @NCNN_VULKAN@)
@@ -44,3 +45,10 @@ if(NCNN_VULKAN)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/ncnn.cmake)

if(TARGET ncnn)
set(ncnn_FOUND TRUE)
if(NOT ncnn_FIND_QUIETLY)
message(STATUS "Found ncnn: ${NCNN_VERSION}")
endif()
endif()

+ 137
- 0
docs/developer-guide/build-ncnn-on-windows-xp.zh.md View File

@@ -0,0 +1,137 @@
# Build ncnn on Windows XP

> **Contributors:** [@Sugar-Baby](https://github.com/Sugar-Baby) and [@AtomAlpaca](https://github.com/AtomAlpaca)

## 0. 环境准备

#### 0.1 虚拟机设置

我使用的是[我的MSDN](https://www.imsdn.cn/)提供的[Windows XP SP3 x64版本](https://www.imsdn.cn/operating-systems/windows-xp/)。虚拟机使用Oracle VM VirtualBox,内存4GB,存储空间64GB(C盘16GB,D盘48GB)。

**在虚拟机关机的情况下**,点击虚拟机管理器界面的"设置"-"网络"-"高级",将控制芯片改为PCnet-FAST III,混杂模式设置为拒绝,勾选接入网线,点击"OK"保存。重启虚拟机就可以连接上网络了。

点击虚拟机界面的"设备"-"安装增强功能...",在虚拟机中进入"我的电脑",刷新后出现"VirtualBox Guest Additions (D: )",右键选择"自动播放",完成安装后重启。

点击虚拟机界面的"设备"-"共享粘贴板",设置为"双向"。点击"设备"-"共享文件夹"-"共享文件夹..",点击右侧加号,在"共享文件夹路径"中选择"其他...",然后选择需要共享的主机文件夹。勾选"自动挂载"和"固定分配",点击"OK"保存。在虚拟机中进入"我的电脑",刷新后出现'VBoxSvr' 上的 <主机文件夹名称>,双击进入就可以双向传输文件了。

#### 0.2 开发环境配置

浏览器推荐[Mypal 68](https://www.mypal-browser.org/download.html),注意要选择32位版本。Windows XP自带ZIP文件解压。安装后就可以访问互联网了。

从Github下载[w64devkit](https://github.com/skeeto/w64devkit),选择x86版本。这里下载的是一个自解压的7z文件,在虚拟机中解压即可。

在"开始"-"控制面板"-"切换到经典视图"-"系统"-"高级"-"环境变量"-"系统变量"中,选择Path,点击"编辑",在字符串末尾加入一个分号(;),然后粘贴w64devkit下bin文件夹的目录。点击"确定"保存之后可以打开命令提示符输入例如c++的命令验证是否成功加入环境变量。

由于年代过于久远,Git的官方release已经没有兼容Windows XP的版本了。最后一个兼容的版本(1.9.5)可以在[这里](https://www.xiazaiba.com/html/29352.html)下载。

为了使用Git,需要安装[Win32 OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)。选择Win32 OpenSSL Light版本。这个过程中会附带安装VC++ 2022运行时库。

如果因为协议、代理等问题不能在虚拟机中使用Git,也可以下载ZIP版本后在虚拟机中解压。

需要手动下载[CMake最后支持Windows XP的版本](https://github.com/Kitware/CMake/releases/download/v3.10.3/cmake-3.10.3-win32-x86.zip)。建议解压在C:\Program Files下,并且需要设置系统变量,到CMake目录下的bin文件夹。具体可以参考上面w64devkit的方法。

## 1. 编译

### 1.1 使用 MinGW-w64

运行

```bash
cd <ncnn-root-dir>
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/windows-xp-mingw.toolchain.cmake -DNCNN_VULKAN=OFF -DNCNN_SIMPLEOCV=ON -DNCNN_AVX=OFF -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ..
make -j2
make install
```

由于平台性能的限制,Vulkan SDK 最低要求 Windows 7 SP1,XP 无法安装官方驱动和工具链,因此需要关闭Vulkan选项。同时需要使用简化版 OpenCV 替代库NCNN_SIMPLEOCV。

### 1.2 使用 Clang

需要先配置 MinGW-w64 环境,然后安装 Clang 6.0 或更高版本。

```bash
cd <ncnn-root-dir>
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/windows-xp-clang.toolchain.cmake -DNCNN_SIMPLEOCV=ON -DNCNN_SIMPLEOMP=ON -DNCNN_AVX=OFF -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ..
make -j2
make install
```

### 1.3 使用 Visual Studio (MSVC)

需要安装支持 Windows XP 的 v141_xp 工具集:

1. 打开 Visual Studio 安装程序(工具 → 获取工具和功能)
2. 选择"使用 C++ 的桌面开发"
3. 在摘要部分选择"对 C++ 的 Windows XP 支持"
4. 点击修改

```bash
cd <ncnn-root-dir>
mkdir build
cd build
cmake -A WIN32 -G "Visual Studio 17 2022" -T v141_xp -DNCNN_SIMPLEOCV=ON -DNCNN_OPENMP=OFF -DNCNN_AVX=OFF -DNCNN_BUILD_WITH_STATIC_CRT=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/windows-xp-msvc.toolchain.cmake ..
cmake --build . --config Release -j 2
cmake --build . --config Release --target install
```

## 2. 测试

### 2.1 benchncnn

将benchmark目录下的所有文件复制到build/benchmark目录下。在命令提示符中cd到build/benchmark, 然后运行

```bash
benchncnn [测试的循环次数] [线程数] [节能模式]
```

其中,节能模式取值为0时关闭,为1时打开。

### 2.2 examples

从[这里](https://github.com/nihui/ncnn-assets/tree/master/models)可以下载到所有需要的param和bin文件。需要注意的是,ZF_faster_rcnn_final.bin开头的三个文件(.zip,.z01,.z02)最好先放在主机上解压出bin文件再传进虚拟机。

把这些文件放在build/examples目录下。

我写了一个bat脚本来批量测试这些模型:

```batch
@echo off
setlocal enabledelayedexpansion

set EXAMPLES_DIR=<ncnn-root-dir>\BUILD\EXAMPLES
set IMAGE_PATH=<ncnn-root-dir>\IMAGES\256-ncnn.png
set LOG_FILE=test_results.log

echo NCNN Examples Test Results > %LOG_FILE%
echo ========================= >> %LOG_FILE%
echo Test started: %date% %time% >> %LOG_FILE%
echo. >> %LOG_FILE%

for %%f in ("%EXAMPLES_DIR%\*.exe") do (
set EXE_NAME=%%~nf
set EXE_PATH=%%f
echo Testing: !EXE_NAME! >> %LOG_FILE%
echo -------------------------------- >> %LOG_FILE%

!EXE_PATH! "%IMAGE_PATH%" >> %LOG_FILE% 2>&1

if errorlevel 1 (
echo [ERROR] !EXE_NAME! failed to run. >> %LOG_FILE%
) else (
echo [SUCCESS] !EXE_NAME! completed. >> %LOG_FILE%
)
echo. >> %LOG_FILE%
)

echo Test finished: %date% %time% >> %LOG_FILE%
echo Results saved to %LOG_FILE%
endlocal
```

把这个bat脚本放在build/examples目录下,替换掉所有的`<ncnn-root-dir>`,双击运行。通过生成的test_results.log即可查看所有模型的结果。

通过修改`set IMAGE_PATH=<ncnn-root-dir>\IMAGES\256-ncnn.png`中的路径来更换需要测试的文件。

+ 2
- 77
docs/developer-guide/glsl-extension.md View File

@@ -168,24 +168,6 @@ shared lfp tmp_a[8][4][2];
|lfp|float|float|float|float16_t|
|lfpvec4|vec4|uvec2|uint64_t|f16vec4|

## image format and precision hint type

declare image format in descriptor binding

```c
layout (binding = 0) uniform unfp sampler3D bottom_blob_3d;
layout (binding = 1, imfmtc4) writeonly uniform unfp image3D top_blob_3d;
```

|format type|fp32|fp16p|fp16s|
|---|---|---|---|
|imfmt1|r32f|f32f|r16f|
|imfmt4|rgba32f|rgba16f|rgba16f|

|precision hint type|fp32|fp16p|fp16s|
|---|---|---|---|
|unfp|highp|mediump|mediump|

# buffer functions

- load typed value from src[offset]
@@ -230,53 +212,6 @@ void buffer_cp4to1(sfp dst, ivec4 dst_offsets, sfpvec4 src, int src_offset);
void buffer_cp8to1(sfp dst, ivec4 dst_offsets_0, ivec4 dst_offsets_1, sfpvec8 src, int src_offset);
void buffer_cp8to4(sfpvec4 dst, ivec2 dst_offsets, sfpvec8 src, int src_offset);
```

# image functions

- load typed value from src at pos

```c
afp image1d_ld1(sampler1D src, float pos);
afp image2d_ld1(sampler2D src, vec2 pos);
afp image3d_ld1(sampler3D src, vec3 pos);
afpvec4 image1d_ld4(sampler1D src, float pos);
afpvec4 image2d_ld4(sampler2D src, vec2 pos);
afpvec4 image3d_ld4(sampler3D src, vec3 pos);
afpvec8 image1d_ld8(sampler1D src, float pos);
afpvec8 image2d_ld8(sampler2D src, vec2 pos);
afpvec8 image3d_ld8(sampler3D src, vec3 pos);
```

- store typed value to dst at pos

```c
void image1d_st1(image1D dst, int pos, afp v);
void image2d_st1(image2D dst, ivec2 pos, afp v);
void image3d_st1(image3D dst, ivec3 pos, afp v);
void image1d_st4(image1D dst, int pos, afpvec4 v);
void image2d_st4(image2D dst, ivec2 pos, afpvec4 v);
void image3d_st4(image3D dst, ivec3 pos, afpvec4 v);
void image1d_st8(image1D dst, int pos, afpvec8 v);
void image2d_st8(image2D dst, ivec2 pos, afpvec8 v);
void image3d_st8(image3D dst, ivec3 pos, afpvec8 v);
```

- copy typed value from src at src_pos to dst at dst_pos

```c
void image1d_cp1(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp1(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp1(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
void image1d_cp4(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp4(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp4(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
void image1d_cp8(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp8(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp8(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
```

Note: Since image is an opaque data structure, no copy and pack/unpack functions are provided. To achieve this operation, you need to load first and then store.

# local data conversion functions

- storage buffer to local memory
@@ -398,7 +333,7 @@ void main()

ncnn will define some additional convenient macros when the vulkan validation layer enabled

* `ncnn_enable_validataion_layer`
* `ncnn_enable_validation_layer`
* `NCNN_LOGE`

currently, you have to modify the `ENABLE_VALIDATION_LAYER` definition at the beginning of `src/gpu.cpp` to `1` to enable these macros.
@@ -410,7 +345,7 @@ void main()
{
int gx = int(gl_GlobalInvocationID.x);

#if ncnn_enable_validataion_layer
#if ncnn_enable_validation_layer
NCNN_LOGE("gx = %d\n", gx);
#endif
}
@@ -439,16 +374,6 @@ void main()
}
```

declare descriptor binding for image or buffer

```c
#if NCNN_image_shader
layout (binding = 0) uniform unfp sampler3D bottom_blob_3d;
#else
layout (binding = 0) readonly buffer bottom_blob { sfpvec4 bottom_blob_data[]; };
#endif
```

|macro|defined by option|
|---|---|
|NCNN_fp16_packed|opt.use_fp16_packed|


+ 99
- 83
docs/developer-guide/glsl-extension.zh.md View File

@@ -76,13 +76,6 @@ NCNN_EXPORT int compile_spirv_module(int shader_type_index, const Option& opt, s
static const char my_glsl_data[] = R"(
#version 450

#if NCNN_fp16_storage
#extension GL_EXT_shader_16bit_storage: require
#endif
#if NCNN_fp16_arithmetic
#extension GL_EXT_shader_explicit_arithmetic_types_float16: require
#endif

layout (binding = 0) readonly buffer a_blob { sfpvec4 a_blob_data[]; };
layout (binding = 1) writeonly buffer b_blob { sfpvec4 b_blob_data[]; };

@@ -139,7 +132,7 @@ layout (binding = 0) buffer top_blob { sfpvec4 top_blob_data[]; };

|存储类型|fp32|fp16p|fp16s|
|---|---|---|---|
|sfp|float|float|float16_t|
|sfp|float|uint|float16_t|
|sfpvec2|vec2|uint|f16vec2|
|sfpvec4|vec4|uvec2|f16vec4|
|sfpvec8|mat2x4|uvec4|f16mat2x4|
@@ -175,24 +168,6 @@ shared lfp tmp_a[8][4][2];
|lfp|float|float|float|float16_t|
|lfpvec4|vec4|uvec2|uint64_t|f16vec4|

## 图像格式类型(image format type)和精度类型(precision hint type)

在描述符绑定中声明图像格式

```c
layout (binding = 0) uniform unfp sampler3D bottom_blob_3d;
layout (binding = 1, imfmtc4) writeonly uniform unfp image3D top_blob_3d;
```

|格式类型|fp32|fp16p|fp16s|
|---|---|---|---|
|imfmt1|r32f|f32f|r16f|
|imfmt4|rgba32f|rgba16f|rgba16f|

|精度类型|fp32|fp16p|fp16s|
|---|---|---|---|
|unfp|highp|mediump|mediump|

# 缓冲区函数(buffer functions)

- 从 src[offset] 加载已经确定类型的值
@@ -238,52 +213,6 @@ void buffer_cp8to1(sfp dst, ivec4 dst_offsets_0, ivec4 dst_offsets_1, sfpvec8 sr
void buffer_cp8to4(sfpvec4 dst, ivec2 dst_offsets, sfpvec8 src, int src_offset);
```

# 图像函数

- 根据 sampler?D 图像(透过 src 和 pos) 来加载数据

```c
afp image1d_ld1(sampler1D src, float pos);
afp image2d_ld1(sampler2D src, vec2 pos);
afp image3d_ld1(sampler3D src, vec3 pos);
afpvec4 image1d_ld4(sampler1D src, float pos);
afpvec4 image2d_ld4(sampler2D src, vec2 pos);
afpvec4 image3d_ld4(sampler3D src, vec3 pos);
afpvec8 image1d_ld8(sampler1D src, float pos);
afpvec8 image2d_ld8(sampler2D src, vec2 pos);
afpvec8 image3d_ld8(sampler3D src, vec3 pos);
```

- 存储确定类型的值到 image?D (透过 dst 和 pos 参数)

```c
void image1d_st1(image1D dst, int pos, afp v);
void image2d_st1(image2D dst, ivec2 pos, afp v);
void image3d_st1(image3D dst, ivec3 pos, afp v);
void image1d_st4(image1D dst, int pos, afpvec4 v);
void image2d_st4(image2D dst, ivec2 pos, afpvec4 v);
void image3d_st4(image3D dst, ivec3 pos, afpvec4 v);
void image1d_st8(image1D dst, int pos, afpvec8 v);
void image2d_st8(image2D dst, ivec2 pos, afpvec8 v);
void image3d_st8(image3D dst, ivec3 pos, afpvec8 v);
```

- 把 sampler?D 的值的内容(透过 src 和 src_pos 参数) 拷贝到 image?D (透过 dst 和 dst_pos 参数)

```c
void image1d_cp1(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp1(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp1(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
void image1d_cp4(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp4(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp4(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
void image1d_cp8(image1D dst, int dst_pos, sampler1D src, float src_pos);
void image2d_cp8(image2D dst, ivec2 dst_pos, sampler2D src, vec2 src_pos);
void image3d_cp8(image3D dst, ivec3 dst_pos, sampler3D src, vec3 src_pos);
```

注意:由于图像是不透明的数据结构,因此不提供复制和打包/解包功能。要实现此操作,您需要先加载,然后再存储。

# 本地数据转换函数

- 存储缓冲区转换到本地内存
@@ -336,27 +265,114 @@ void main()
#endif
```

# 条件宏定义与option的关系
ncnn 在新版本中添加了额外的宏定义,可能与现在的 glsl 代码冲突或引起混淆。为了实现 ncnn 的跨版本兼容性,可以根据 `ncnn_glsl_version` 宏的版本号在新旧代码之间进行切换 。

仅当用户启用某些选项时才启用 GLSL 扩展
```c
#if ncnn_glsl_version >= 1
// 使用自版本 1 起引入的设备宏
#endif
```

ncnn 额外定义了大多数 vulcan 设备相关功能作为宏,我们可以用来区分不同的平台、设备扩展、功能和属性。

### 扩展宏定义

当设备支持某个扩展时,`ncnn_<extension_name>` 被定义为扩展版本

```c
#if NCNN_fp16_storage
#extension GL_EXT_shader_16bit_storage: require
void main()
{
#if ncnn_VK_KHR_16bit_storage
// 支持 VK_KHR_16bit_storage 设备的代码
#endif
#if NCNN_fp16_arithmetic
#extension GL_EXT_shader_explicit_arithmetic_types_float16: require

#if ncnn_VK_KHR_sampler_ycbcr_conversion >= 10
// 支持 VK_KHR_sampler_ycbcr_conversion 且版本 >=10 的代码
#endif
}
```

声明图像或缓冲区的描述符绑定
### 设备特性和属性宏

ncnn 会查询设备特性和属性,然后将它们定义为宏。

宏名称为 `ncnn_<feature_name>` 或 `ncnn_<property_name>`

当设备支持 `shaderInt64` 时,`GL_EXT_shader_explicit_arithmetic_types_int64` 扩展会自动启用,无需显式代码指示。

```c
void main()
{
#if ncnn_robustBufferAccess
// 支持 robustBufferAccess 特性的设备代码
#endif

#if ncnn_vendorID == 4318
// 供应商特定代码,4318 是 nvidia 显卡
#endif

#if ncnn_subgroupSize == 32
// 为 subgroup_size == 32 优化的代码路径
#endif

// 使用宏定义
uint size; // 来自先前例程的动态值
if (size < ncnn_subgroupSize)
{
#if ncnn_supportedOperations & 4
// subgroup 支持算术运算
#endif

#if ncnn_subgroup_arithmetic
// 检查 subgroup 算术运算的简写形式
#endif
}
}
```

### 验证层宏定义

当启用 vulkan 验证层时,ncnn 会定义一些额外的便捷宏

* `ncnn_enable_validation_layer`
* `NCNN_LOGE`

目前,你必须将 `src/gpu.cpp` 开头的 `ENABLE_VALIDATION_LAYER` 定义修改为 `1` 才能启用这些宏。

`GL_EXT_debug_printf` 扩展会自动启用,无需在代码中显式指定。

```c
#if NCNN_image_shader
layout (binding = 0) uniform unfp sampler3D bottom_blob_3d;
#else
layout (binding = 0) readonly buffer bottom_blob { sfpvec4 bottom_blob_data[]; };
void main()
{
int gx = int(gl_GlobalInvocationID.x);

#if ncnn_enable_validation_layer
NCNN_LOGE("gx = %d\n", gx);
#endif
}
```

在运行时,`NCNN_LOGE` 将打印出 `gx` 的值

### 选项宏

仅当用户启用某些选项时才启用 GLSL 扩展

`GL_EXT_shader_16bit_storage` 扩展会在设备支持 16 位存储且用户开启了 `opt.use_fp16_storage` 选项时,自动启用,无需显式代码指示。

`GL_EXT_shader_explicit_arithmetic_types_float16` 扩展会在设备支持 16 位算术运算且用户开启了 `opt.use_fp16_arithmetic` 选项时,自动启用,无需显式代码指示。

```c
void main()
{
#if NCNN_fp16_storage
// 用户启用 fp16 存储选项,且设备支持 fp16 存储
#endif

#if NCNN_fp16_arithmetic
// 用户启用 fp16 算术选项,且设备支持 fp16 算术运算
#endif
}
```

|宏定义|option中所定义的变量|


+ 76
- 1
docs/how-to-build/how-to-build.md View File

@@ -16,9 +16,14 @@ git submodule update --init
- [Verification](#verification)
- [Build for Windows x64 using Visual Studio Community 2017](#build-for-windows-x64-using-visual-studio-community-2017)
- [Build for Windows x64 using MinGW-w64](#build-for-windows-x64-using-mingw-w64)
- [Build for Windows XP (x86)](#build-for-windows-xp-x86)
- [Using MinGW-w64](#using-mingw-w64)
- [Using Clang](#using-clang)
- [Using Visual Studio (MSVC)](#using-visual-studio-msvc)
- [Build for macOS](#build-for-macos)
- [Build for ARM Cortex-A family with cross-compiling](#build-for-arm-cortex-a-family-with-cross-compiling)
- [Build for Hisilicon platform with cross-compiling](#build-for-hisilicon-platform-with-cross-compiling)
- [Build for AnyCloud platform with cross-compiling](#build-for-AnyCloud-platform-with-cross-compiling)
- [Build for Android](#build-for-android)
- [Build for iOS on macOS with xcode](#build-for-ios-on-macos-with-xcode)
- [Build for WebAssembly](#build-for-webassembly)
@@ -262,6 +267,57 @@ cmake --build . --config Release --target install

***

### Build for Windows XP (x86)

> **Note:** Windows XP support is provided through collaborative contributions from [@Sugar-Baby](https://github.com/Sugar-Baby) and [@AtomAlpaca](https://github.com/AtomAlpaca).

#### Using MinGW-w64

Download mingw toolchain targeting 32 bit from [sourceforge](https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z), extract and add environment variable named `MINGW32_ROOT_PATH` valued by `<your-path-to-mingw-root-path>`, and add `<your-path-to-mingw-root-path>/bin` to `PATH`.

```shell
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-mingw.toolchain.cmake" -DNCNN_SIMPLEOCV=ON -DNCNN_AVX2=OFF -DNCNN_AVX=OFF -DNCNN_VULKAN=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
cmake --build . --config Release --target install
```

#### Using Clang

Clang requires libraries from mingw. Configure mingw toolchain targeting 32-bit as described in the [MinGW-w64 section](#using-mingw-w64).

Install Clang 6.0 or later.

```shell
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-clang.toolchain.cmake" -DNCNN_SIMPLEOCV=ON -DNCNN_SIMPLEOMP=ON -DNCNN_AVX2=OFF -DNCNN_AVX=OFF .. -G "MinGW Makefiles"
cmake --build . --config Release -j 4
cmake --build . --config Release --target install
```

#### Using Visual Studio (MSVC)

Install v141_xp toolset for Windows XP:

1. Bring up the Visual Studio installer (Tools → Get Tools and Features)
2. Select Desktop development with C++
3. Select Windows XP support for C++ from the Summary section
4. Click Modify

```shell
mkdir build
cd build
cmake -A WIN32 -G "Visual Studio 17 2022" -T v141_xp -DNCNN_SIMPLEOCV=ON -DNCNN_OPENMP=OFF -DNCNN_AVX2=OFF -DNCNN_AVX=OFF -DNCNN_BUILD_WITH_STATIC_CRT=ON -DCMAKE_TOOLCHAIN_FILE="../toolchains/windows-xp-msvc.toolchain.cmake" ..
cmake --build . --config Release -j 2
cmake --build . --config Release --target install
```

**Note:** The MSVC toolchain uses the `v141_xp` platform toolset for Windows XP compatibility. Vulkan is disabled for XP compatibility, and advanced CPU features (AVX, AVX2, AVX512) are disabled to ensure compatibility with older processors.

***

### Build for macOS

We've published ncnn to [brew](https://formulae.brew.sh/formula/ncnn#default) now, you can just use following method to install ncnn if you have the Xcode Command Line Tools installed.
@@ -349,7 +405,8 @@ make -j$(nproc)
***

### Build for Hisilicon platform with cross-compiling
Download and install Hisilicon SDK. The toolchain should be in `/opt/hisi-linux/x86-arm`
Download and install Hisilicon SDK. The toolchain should be in `/opt/hisi-linux/x86-arm`
new version of Hisilicon toolchain should be in `/opt/linux/x86-arm/`

```shell
cd <ncnn-root-dir>
@@ -361,6 +418,24 @@ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/hisiv300.toolchain.cmake ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/hisiv500.toolchain.cmake ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/himix100.toolchain.cmake ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/himix200.toolchain.cmake ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/himix210.toolchain.cmake ..

make -j$(nproc)
make install
```

***

### Build for AnyCloud platform with cross-compiling
Download and install AnyCloud SDK. And load env to set toolchain can access in shell

```shell
cd <ncnn-root-dir>
mkdir -p build
cd build

# Choose one cmake toolchain file depends on your target platform
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/anykav500.toolchain.cmake ..

make -j$(nproc)
make install


+ 2
- 13
examples/fasterrcnn.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/mobilenetssd.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/mobilenetv2ssdlite.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/mobilenetv3ssdlite.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"
#include "platform.h"


+ 2
- 13
examples/nanodet.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/nanodetplus_pnnx.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/p2pnet.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2021 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"
#if defined(USE_NCNN_SIMPLEOCV)


+ 2
- 13
examples/peleenetssd_seg.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/ppocrv5.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// pip install paddlepaddle==3.0.0
// pip install paddleocr==3.0.0


+ 2
- 13
examples/ppocrv5_dict.h View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

static const char* character_dict[] = {
" ",


+ 2
- 13
examples/retinaface.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2019 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/rfcn.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/rvm.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// ncnn model exported from https://github.com/PeterL1n/RobustVideoMatting
//


+ 2
- 13
examples/scrfd.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2021 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/scrfd_crowdhuman.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2021 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/shufflenetv2.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/simplepose.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2019 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/squeezenet.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/squeezenet_c_api.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "c_api.h"



+ 2
- 13
examples/squeezenetssd.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2017 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/yolact.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/yolo11.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolo11_cls.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolo11_obb.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolo11_pose.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolo11_seg.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolov2.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/yolov3.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2018 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/yolov4.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "net.h"



+ 2
- 13
examples/yolov5.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "layer.h"
#include "net.h"


+ 2
- 13
examples/yolov5_pnnx.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2022 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "layer.h"
#include "net.h"


+ 2
- 13
examples/yolov7.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2020 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "layer.h"
#include "net.h"


+ 2
- 13
examples/yolov7_pnnx.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2022 Tencent
// SPDX-License-Identifier: BSD-3-Clause

#include "layer.h"
#include "net.h"


+ 2
- 13
examples/yolov8.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2024 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolov8_cls.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2024 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolov8_obb.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2024 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolov8_pose.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2024 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yolov8_seg.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2024 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 2
- 13
examples/yoloworld.cpp View File

@@ -1,16 +1,5 @@
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// Copyright 2025 Tencent
// SPDX-License-Identifier: BSD-3-Clause

// 1. install
// pip3 install -U ultralytics pnnx ncnn


+ 3
- 14
examples/yolox.cpp View File

@@ -1,17 +1,6 @@
// This file is wirtten base on the following file:
// https://github.com/Tencent/ncnn/blob/master/examples/yolov5.cpp
// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-3-Clause
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// ------------------------------------------------------------------------------
// Copyright (C) 2020-2021, Megvii Inc. All rights reserved.
// Copyright 2020 Tencent
// Copyright 2020-2021 Megvii Inc.
// SPDX-License-Identifier: BSD-3-Clause

#include "layer.h"
#include "net.h"


+ 2
- 13
python/examples/fasterrcnn.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/mobilenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/mobilenetv2ssdlite.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/mobilenetv3ssdlite.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/model_zoo.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

from ncnn.model_zoo import get_model_list



+ 2
- 13
python/examples/nanodet.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2021 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/peleenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/retinaface.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/rfcn.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/shufflenetv2.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/simplepose.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/squeezenet.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/squeezenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolact.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolov2.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolov3.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolov4.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolov5.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/examples/yolov8.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import sys
import cv2


+ 2
- 13
python/ncnn/__init__.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

from .ncnn import *



+ 2
- 13
python/ncnn/model_zoo/__init__.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

# coding: utf-8
"""Predefined and pretrained models."""


+ 2
- 13
python/ncnn/model_zoo/fasterrcnn.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/mobilenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/mobilenetv2ssdlite.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/mobilenetv3ssdlite.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/model_store.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

"""Model store which provides pretrained models."""
from __future__ import print_function


+ 2
- 13
python/ncnn/model_zoo/model_zoo.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

from .yolov2 import MobileNet_YoloV2
from .yolov3 import MobileNetV2_YoloV3


+ 2
- 13
python/ncnn/model_zoo/nanodet.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2021 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/peleenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/retinaface.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/rfcn.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/shufflenetv2.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/simplepose.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/squeezenet.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
import ncnn


+ 2
- 13
python/ncnn/model_zoo/squeezenetssd.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/yolact.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

from math import sqrt
import numpy as np


+ 2
- 13
python/ncnn/model_zoo/yolov2.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/yolov3.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/yolov4.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/yolov5.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import time
import numpy as np


+ 5
- 13
python/ncnn/model_zoo/yolov7.py View File

@@ -1,18 +1,10 @@
# Kenny Bradley 2023
# Copyright 2020 Tencent
# Copyright 2023 Kenny Bradley
# SPDX-License-Identifier: BSD-3-Clause

# Ported yolov7-tiny to python based on:
# - https://github.com/Qengineering/YoloV7-ncnn-Raspberry-Pi-4/blob/main/yolo.cpp
#
# Format based on the ncnn yolov4 implementation by THL A29 Limited, a Tencent company
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Format based on the ncnn yolov4 implementation

import ncnn
from .model_store import get_model_file


+ 2
- 13
python/ncnn/model_zoo/yolov8.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import time
import numpy as np


+ 2
- 13
python/ncnn/utils/__init__.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

from .download import download, check_sha1
from .visual import *


+ 2
- 13
python/ncnn/utils/download.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

"""Download files with progress bar."""



+ 2
- 13
python/ncnn/utils/functional.py View File

@@ -1,16 +1,5 @@
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# Copyright 2020 Tencent
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np



Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save