apt-get-install_user_manual.md 4.8 KB
Newer Older
N
NesQl 已提交
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181

# apt-get 安装和使用Tengine 

### 功能说明 
   基于标准的ubuntu系统,Tengine提供了命令行的安装方式,通过apt-get命令,可下载Tengine库,并且同步提供相应的预置Demo,欢迎大家试用。
	

 **以下所有命令均在设备的命令行运行**
 
| 硬件     | 系统 | 
| ------- | ------- |
|   x86   |  ubuntu18.04     |
|   A311D |  ubuntu18.04     |


## 1. 客户端配置APT源 

### X86配置源命令:

```
echo deb [trusted=yes] http://58.33.201.109:8099/x86/ focal main | sudo tee -a /etc/apt/sources.list
```

### A311D板子配置源命令:

```
echo deb [trusted=yes] http://58.33.201.109:8099/a311d/ focal main | sudo tee -a /etc/apt/sources.list
```

## 2. 更新源

```
sudo apt-get update

```


## 3. 客户端下载tengine

```
sudo apt-get install tengine
```

## 4. 下载的tengine目录结构

###  X86:
```
/usr/
├── bin
│   ├── convert_tool
│   ├── quant_tool_uint8
│   ├── tm_classification
│   └── tm_yolov5s
├── include
│   └── tengine
│       ├── c_api.h
│       └── defines.h
├── lib
│   └── libtengine-lite.so
└── share
    ├── cat.jpg
    ├── mobilenet.tmfile
    ├── ssd_dog.jpg
    └── yolov5s.tmfile
```

###  A311D:

```
/usr/
├── bin
│   ├── tm_classification
│   ├── tm_yolov5s
│   └── tm_yolov5s_timvx
├── include
│   └── tengine
│       ├── c_api.h
│       └── defines.h
├── lib
│   └── libtengine-lite.so
└── share
    ├── cat.jpg
    ├── mobilenet.tmfile
    ├── ssd_dog.jpg
    ├── yolov5s.tmfile
    └── yolov5s_uint8.tmfile
```

## 5.Demo运行示例

###  X86平台

**分类网络示例**
```
peter@test-server:/usr/bin$ ./tm_classification -m /usr/share/mobilenet.tmfile -i /usr/share/cat.jpg 
Image height not specified, use default 224
Image width not specified, use default  224
Scale value not specified, use default  0.0, 0.0, 0.0
Mean value not specified, use default   104.0, 116.7, 122.7
tengine-lite library version: 1.5-dev

model file : /usr/share/mobilenet.tmfile
image file : /usr/share/cat.jpg
img_h, img_w, scale[3], mean[3] : 224 224 , 0.017 0.017 0.017, 104.0 116.7 122.7
Repeat 1 times, thread 1, avg time 23.36 ms, max_time 23.36 ms, min_time 23.36 ms
--------------------------------------
8.574143, 282
7.880117, 277
7.812573, 278
7.286458, 263
6.357487, 281
--------------------------------------
```

**检测网络示例**
```
peter@test-server:/usr/bin$ ./tm_yolov5s -m /usr/share/yolov5s.tmfile -i /usr/share/ssd_dog.jpg 
tengine-lite library version: 1.5-dev
Repeat 1 times, thread 1, avg time 306.23 ms, max_time 306.23 ms, min_time 306.23 ms
--------------------------------------
detection num: 3
16:  89%, [ 135,  218,  313,  558], dog
 7:  86%, [ 472,   78,  689,  169], truck
 1:  75%, [ 124,  107,  578,  449], bicycle
--------------------------------------
```



### A311D

**分类网络示例-cpu**

```
cd /usr/bin/
khadas@Khadas:/usr/bin$ ./tm_classification -m /usr/share/mobilenet.tmfile -i /usr/share/cat.jpg 
Image height not specified, use default 224
Image width not specified, use default  224
Scale value not specified, use default  0.0, 0.0, 0.0
Mean value not specified, use default   104.0, 116.7, 122.7
tengine-lite library version: 1.5-dev

model file : /usr/share/mobilenet.tmfile
image file : /usr/share/cat.jpg
img_h, img_w, scale[3], mean[3] : 224 224 , 0.017 0.017 0.017, 104.0 116.7 122.7
Repeat 1 times, thread 1, avg time 104.37 ms, max_time 104.37 ms, min_time 104.37 ms
--------------------------------------
8.574153, 282
7.880111, 277
7.812575, 278
7.286450, 263
6.357493, 281
--------------------------------------
```

**检测网络示例-CPU**
```
khadas@Khadas:/usr/bin$ ./tm_yolov5s -m /usr/share/yolov5s.tmfile -i /usr/share/ssd_dog.jpg 
tengine-lite library version: 1.5-dev
Repeat 1 times, thread 1, avg time 1369.74 ms, max_time 1369.74 ms, min_time 1369.74 ms
--------------------------------------
detection num: 3
16:  89%, [ 135,  218,  313,  558], dog
 7:  86%, [ 472,   78,  689,  169], truck
 1:  75%, [ 123,  107,  578,  449], bicycle
--------------------------------------
```

**检测网络示例-NPU**
```
khadas@Khadas:/usr/bin$ ./tm_yolov5s_timvx -m /usr/share/yolov5s_uint8.tmfile -i /usr/share/ssd_dog.jpg 
Please make sure Galcore Sdk version > 6.4.4,Please refer to https://github.com/OAID/Tengine/blob/tengine-lite/doc/npu_tim-vx_user_manual_zh.md for more information
tengine-lite library version: 1.5-dev
Repeat 1 times, thread 1, avg time 68.33 ms, max_time 68.33 ms, min_time 68.33 ms
--------------------------------------
detection num: 3
16:  89%, [ 136,  224,  313,  550], dog
 7:  87%, [ 473,   72,  692,  171], truck
 1:  75%, [ 129,  108,  578,  443], bicycle
--------------------------------------
```