TX2搭建YOLOv3目标检测算法

git clone https://github.com/pjreddie/darknet.git
cd darknet
打开darknet文件夹中的Makefile
将其修改成如下,使用GPU,CUDNN,OPENCV

GPU=1
CUDNN=1
OPENCV=1
OPENMP=0
DEBUG=0
 
ARCH= -gencode arch=compute_53,code=[sm_53,compute_53] \
      -gencode arch=compute_62,code=[sm_62,compute_62]
#      -gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?
# This is what I use, uncomment if you know your arch and want to specify
# ARCH= -gencode arch=compute_52,code=compute_52

编译
make -j4

测试YOLOv3

下载weights文件
wget https://pjreddie.com/media/files/yolov3.weights
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

下载模型减枝后的weights文件
wget https://pjreddie.com/media/files/yolov3-tiny.weights
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg

使用摄像头进行实时检测
外置摄像头
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights -c 1
视频文件
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights
板载摄像头
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights “nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height(int)720, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink”

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值