-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_ncnn_gpu.bash
59 lines (40 loc) · 1.59 KB
/
install_ncnn_gpu.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## Commands
# 1) sudo apt install build-essential git cmake libprotobuf-dev protobuf-compiler libvulkan-dev vulkan-utils libopencv-dev
# 2) Check gpu using command `vulkaninfo | grep deviceType` it will give output deviceType = DISCRETE_GPU
# 3) sudo chmod +x install_ncnn_gpu.sh
# 4) ./install_ncnn_gpu.sh
sudo mkdir -p /opt/tools
sudo chmod -R 777 /opt/tools
cd /opt/tools
git clone https://github.com/Tencent/ncnn.git
cd ncnn
git submodule init && git submodule update
mkdir -p build && cd build
# set DNCNN_VULKAN=ON on GPU
sudo cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_VULKAN=ON -DNCNN_PYTHON=ON -DNCNN_SYSTEM_GLSLANG=OFF -DNCNN_BUILD_EXAMPLES=ON ..
sudo make -j$(nproc)
# -------------------------------------------------
# python
# -------------------------------------------------
# Install
# 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
cd ../python
python3 -m pip install .
# ------------------------------------------------------
# Model Zoo
# -----------------------------------------------------
# install requirements
# pip install -r 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())
python3 -m pip install -r requirements.txt
# ---------------------------------------------------
# cmd usage
# ---------------------------------------------------
# python examples/retinaface.py "path/to/image"