Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| examples | 5 years ago | |
| ncnn | 5 years ago | |
| pybind11 @ d587a2fd17 | 5 years ago | |
| src | 5 years ago | |
| tests | 5 years ago | |
| CMakeLists.txt | 5 years ago | |
| README.md | 5 years ago | |
| requirements.txt | 5 years ago | |
| setup.py.i | 5 years ago | |
python wrapper of ncnn with pybind11, only support python3.x now.
On Unix (Linux, OS X)
On Windows
cd /pathto/ncnn
git submodule init && git submodule update
mkdir build
cd build
cmake -DNCNN_BUILD_PYTHON=ON ..
make
cd /pathto/ncnn/python
pip install .
if you use conda or miniconda, you can also install as following:
cd /pathto/ncnn/python
python3 setup.py install
test
cd /pathto/ncnn/python
python3 tests/test.py
benchmark
cd /pathto/ncnn/python
python3 tests/benchmark.py
ncnn.Mat->numpy.array, with no memory copy
mat = ncnn.Mat(...)
mat_np = np.array(mat)
numpy.array->ncnn.Mat, with no memory copy
mat_np = np.array(...)
mat = ncnn.Mat(mat_np)
install requirements
pip install -U requirements.txt
then you can import ncnn.model_zoo and get model list as follow:
import ncnn
import ncnn.model_zoo as model_zoo
print(model_zoo.get_model_list())
all model in model zoo has example in ncnn/python/examples folder
custom layer demo is in ncnn/python/ncnn/model_zoo/yolov5.py:23
No Description
C++ C Python Text Protocol Buffer other