【darknet 学习笔记-01】darknet安装

本文记录了darknet的安装过程,包括下载源码、修改darknet.c文件并编译,以及加载预训练的yolov3权重进行物体检测的测试,展示了初步使用darknet进行检测的结果。
摘要由CSDN通过智能技术生成

下载:

git clone https://github.com/pjreddie/darknet
cd darknet

对darknet/example/darknet.c main()部分添加两行代码,如下所示:

printf("argc = %d\n", argc);
for(int i = 0; i < argc; i ++)
    printf("%d, %s\n", i, argv[i]);

进行编译:

make

下载yolov3预先训练的权重:

wget https://pjreddie.com/media/files/yolov3.weights

测试检测器:

./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

结果如下所示:

argc = 5
0, ./darknet
1, detect
2, cfg/yolov3.cfg
3, yolov3.weights
4, data/dog.jpg
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   608 x 608 x   3   ->   608 x 608 x  32  0.639 BFLOPs
    1 conv     64  3 x 3 / 2   608 x 608 x  32   ->   304 x 304 x  64  3.407 BFLOPs
    2 conv     32  1 x 1 / 1   304 x 304 x  64   ->   304 x 304 x  32  0.379 BFLOPs
    3 conv     64  3 x 3 / 1   304 x 304 x  32   ->   304 x 304 x  64  3.407 BFLOPs
    4 res    1                 304 x 304 x  64   ->   304 x 304 x  64
    5 conv    128  3 x 3 / 2   304 x 304 x  64   ->   152 x 152 x 128  3.407 BFLOPs
    6 conv     64  1 x 1 / 1   152 x 152 x 128   ->   152 x 152 x  64  0.379 BFLOPs
    7 conv    128  3 x 3 / 1   152 x 152 x  64   ->   152 x 152 x 128  3.407 BFLOPs
    8 res    5                 152 x 152 x 128   ->   152 x 152 x 128
    9 conv     64  1 x 1 / 1   152 x 152 x 128   ->   152 x 152 x  64  0.379 BFLOPs
   10 conv    128  3 x 3 / 1   152 
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值