赵美京₁₉⁸⁸⁸ 发表于 2024-4-30 16:54:31

【树莓派5 测评】 + 16.yolo-v3测试(zmj)

【树莓派5 测评】 + 16.yolo-v3测试(zmj)
YOLO是You Look once的简称,是目标检测算法中比较常用的一种算法。YOLO-V3是目标检测算法中的YOLO算法的第三个版本。在这个版本中其实并没有太多的创新点,更多的是借鉴了前两个版本,但是却在保持速度的同时,在精度上做了优化。YOLO-V3所使用的主干特征提取网络为Darknet53,它作为一个单独的神经网络作用在图像上,将图像划分成多个区域并且预测边界框和每个区域的概率。//------darknet
https://pjreddie.com/darknet/


1.      安装YOLO安装YOLO的过程十分简单,下载darknet后编译即可。//------安装指令
//---下载并进入darknet目录
git clone https://github.com/pjreddie/darknet
cd darknet
//---编译安装
make
//------下载权重模型并测试
//---yolov3-tiny
wget https://pjreddie.com/media/files/yolov3-tiny.weights
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg
//---yolov3
wget https://pjreddie.com/media/files/yolov3.weights
./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
2.      模型下载及测试测试yolov3-tiny和yolov3这两种模型。2.1      下载测试//------下载权重模型并测试
//---yolov3-tiny
wget https://pjreddie.com/media/files/yolov3-tiny.weights
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg
//---yolov3
wget https://pjreddie.com/media/files/yolov3.weights
./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
//------Log信息
zhaomeijing@raspberrypi5:~/workspace/04_yolo/darknet$ ./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg
layer   filters    size            input                output
    0 conv   163 x 3 / 1   416 x 416 x   3   ->   416 x 416 x160.150 BFLOPs
    1 max          2 x 2 / 2   416 x 416 x16   ->   208 x 208 x16
    2 conv   323 x 3 / 1   208 x 208 x16   ->   208 x 208 x320.399 BFLOPs
    3 max          2 x 2 / 2   208 x 208 x32   ->   104 x 104 x32
    4 conv   643 x 3 / 1   104 x 104 x32   ->   104 x 104 x640.399 BFLOPs
    5 max          2 x 2 / 2   104 x 104 x64   ->    52 x52 x64
    6 conv    1283 x 3 / 1    52 x52 x64   ->    52 x52 x 1280.399 BFLOPs
    7 max          2 x 2 / 2    52 x52 x 128   ->    26 x26 x 128
    8 conv    2563 x 3 / 1    26 x26 x 128   ->    26 x26 x 2560.399 BFLOPs
    9 max          2 x 2 / 2    26 x26 x 256   ->    13 x13 x 256
   10 conv    5123 x 3 / 1    13 x13 x 256   ->    13 x13 x 5120.399 BFLOPs
   11 max          2 x 2 / 1    13 x13 x 512   ->    13 x13 x 512
   12 conv   10243 x 3 / 1    13 x13 x 512   ->    13 x13 x10241.595 BFLOPs
   13 conv    2561 x 1 / 1    13 x13 x1024   ->    13 x13 x 2560.089 BFLOPs
   14 conv    5123 x 3 / 1    13 x13 x 256   ->    13 x13 x 5120.399 BFLOPs
   15 conv    2551 x 1 / 1    13 x13 x 512   ->    13 x13 x 2550.044 BFLOPs
   16 yolo
   17 route13
   18 conv    1281 x 1 / 1    13 x13 x 256   ->    13 x13 x 1280.011 BFLOPs
   19 upsample            2x    13 x13 x 128   ->    26 x26 x 128
   20 route19 8
   21 conv    2563 x 3 / 1    26 x26 x 384   ->    26 x26 x 2561.196 BFLOPs
   22 conv    2551 x 1 / 1    26 x26 x 256   ->    26 x26 x 2550.088 BFLOPs
   23 yolo
Loading weights from yolov3-tiny.weights...Done!
data/dog.jpg: Predicted in 0.873869 seconds.
dog: 57%
car: 52%
truck: 56%
car: 62%
bicycle: 59%
zhaomeijing@raspberrypi5:~/workspace/04_yolo/darknet$ ./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
layer   filters    size            input                output
    0 conv   323 x 3 / 1   608 x 608 x   3   ->   608 x 608 x320.639 BFLOPs
    1 conv   643 x 3 / 2   608 x 608 x32   ->   304 x 304 x643.407 BFLOPs
    2 conv   321 x 1 / 1   304 x 304 x64   ->   304 x 304 x320.379 BFLOPs
    3 conv   643 x 3 / 1   304 x 304 x32   ->   304 x 304 x643.407 BFLOPs
    4 res    1               304 x 304 x64   ->   304 x 304 x64
    5 conv    1283 x 3 / 2   304 x 304 x64   ->   152 x 152 x 1283.407 BFLOPs
    6 conv   641 x 1 / 1   152 x 152 x 128   ->   152 x 152 x640.379 BFLOPs
    7 conv    1283 x 3 / 1   152 x 152 x64   ->   152 x 152 x 1283.407 BFLOPs
    8 res    5               152 x 152 x 128   ->   152 x 152 x 128
    9 conv   641 x 1 / 1   152 x 152 x 128   ->   152 x 152 x640.379 BFLOPs
   10 conv    1283 x 3 / 1   152 x 152 x64   ->   152 x 152 x 1283.407 BFLOPs
   11 res    8               152 x 152 x 128   ->   152 x 152 x 128
   12 conv    2563 x 3 / 2   152 x 152 x 128   ->    76 x76 x 2563.407 BFLOPs
   13 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   14 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   15 res   12                  76 x76 x 256   ->    76 x76 x 256
   16 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   17 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   18 res   15                  76 x76 x 256   ->    76 x76 x 256
   19 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   20 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   21 res   18                  76 x76 x 256   ->    76 x76 x 256
   22 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   23 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   24 res   21                  76 x76 x 256   ->    76 x76 x 256
   25 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   26 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   27 res   24                  76 x76 x 256   ->    76 x76 x 256
   28 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   29 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   30 res   27                  76 x76 x 256   ->    76 x76 x 256
   31 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   32 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   33 res   30                  76 x76 x 256   ->    76 x76 x 256
   34 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
   35 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
   36 res   33                  76 x76 x 256   ->    76 x76 x 256
   37 conv    5123 x 3 / 2    76 x76 x 256   ->    38 x38 x 5123.407 BFLOPs
   38 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   39 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   40 res   37                  38 x38 x 512   ->    38 x38 x 512
   41 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   42 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   43 res   40                  38 x38 x 512   ->    38 x38 x 512
   44 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   45 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   46 res   43                  38 x38 x 512   ->    38 x38 x 512
   47 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   48 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   49 res   46                  38 x38 x 512   ->    38 x38 x 512
   50 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   51 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   52 res   49                  38 x38 x 512   ->    38 x38 x 512
   53 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   54 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   55 res   52                  38 x38 x 512   ->    38 x38 x 512
   56 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   57 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   58 res   55                  38 x38 x 512   ->    38 x38 x 512
   59 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   60 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   61 res   58                  38 x38 x 512   ->    38 x38 x 512
   62 conv   10243 x 3 / 2    38 x38 x 512   ->    19 x19 x10243.407 BFLOPs
   63 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   64 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   65 res   62                  19 x19 x1024   ->    19 x19 x1024
   66 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   67 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   68 res   65                  19 x19 x1024   ->    19 x19 x1024
   69 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   70 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   71 res   68                  19 x19 x1024   ->    19 x19 x1024
   72 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   73 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   74 res   71                  19 x19 x1024   ->    19 x19 x1024
   75 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   76 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   77 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   78 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   79 conv    5121 x 1 / 1    19 x19 x1024   ->    19 x19 x 5120.379 BFLOPs
   80 conv   10243 x 3 / 1    19 x19 x 512   ->    19 x19 x10243.407 BFLOPs
   81 conv    2551 x 1 / 1    19 x19 x1024   ->    19 x19 x 2550.189 BFLOPs
   82 yolo
   83 route79
   84 conv    2561 x 1 / 1    19 x19 x 512   ->    19 x19 x 2560.095 BFLOPs
   85 upsample            2x    19 x19 x 256   ->    38 x38 x 256
   86 route85 61
   87 conv    2561 x 1 / 1    38 x38 x 768   ->    38 x38 x 2560.568 BFLOPs
   88 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   89 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   90 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   91 conv    2561 x 1 / 1    38 x38 x 512   ->    38 x38 x 2560.379 BFLOPs
   92 conv    5123 x 3 / 1    38 x38 x 256   ->    38 x38 x 5123.407 BFLOPs
   93 conv    2551 x 1 / 1    38 x38 x 512   ->    38 x38 x 2550.377 BFLOPs
   94 yolo
   95 route91
   96 conv    1281 x 1 / 1    38 x38 x 256   ->    38 x38 x 1280.095 BFLOPs
   97 upsample            2x    38 x38 x 128   ->    76 x76 x 128
   98 route97 36
   99 conv    1281 x 1 / 1    76 x76 x 384   ->    76 x76 x 1280.568 BFLOPs
100 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
101 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
102 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
103 conv    1281 x 1 / 1    76 x76 x 256   ->    76 x76 x 1280.379 BFLOPs
104 conv    2563 x 3 / 1    76 x76 x 128   ->    76 x76 x 2563.407 BFLOPs
105 conv    2551 x 1 / 1    76 x76 x 256   ->    76 x76 x 2550.754 BFLOPs
106 yolo
Loading weights from yolov3.weights...Done!
data/dog.jpg: Predicted in 21.122667 seconds.
dog: 100%
truck: 92%
bicycle: 99%
zhaomeijing@raspberrypi5:~/workspace/04_yolo/darknet$2.2      测试结果展示及分析yolov3-tiny测试结果:yolov3测试结果:

序号名称精度时间(单位:秒)
1yolov3-tiny低快:0.873869
2.yolov3高慢:21.122667
通过测试结果可以得知yolov3的精度更高但是耗时,yolov3-tiny的速度最快但是精度不高。
//------end

页: [1]
查看完整版本: 【树莓派5 测评】 + 16.yolo-v3测试(zmj)