agx xavier配置yolo darknet

安装opencv3.4

mkdir -p ~/tools/
cd ~/tools/
sudo gedit installOpencv340Xavier.sh
添加以下内容,也可以逐行执行

#!/bin/bash
#
# Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.
#


echo "** Install requirement"
sudo apt-get update
sudo apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install -y python2.7-dev
sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
sudo apt-get install -y libv4l-dev v4l-utils qv4l2 v4l2ucp
sudo apt-get install -y curl
sudo apt-get update

echo "** Download opencv-3.4.0"
curl -L https://github.com/opencv/opencv/archive/3.4.0.zip -o opencv-3.4.0.zip
unzip opencv-3.4.0.zip 
cd opencv-3.4.0/

echo "** Building..."
mkdir release
cd release/
cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="7.2"  -D CUDA_ARCH_PTX="" -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..

make
sudo make install

echo "** Install opencv-3.4.0 successfully"
echo "** Bye :)"

sudo chmod +x installOpencv340Xavier.sh 
./installOpencv340Xavier.sh 

darknet

mkdir -p ~/dl/darknet
cd ~/dl/darknet
git clone https://github.com/pjreddie/darknet.git
cd darknet

修改makefile

GPU=1
CUDNN=1
OPENCV=1
OPENMP=1
DEBUG=1

ARCH= -gencode arch=compute_72,code=[sm_72,compute_72]

#cuda路劲
NVCC=/usr/local/cuda-10.2/bin/nvcc
#上面这个是我板子上cuda路劲,根据自己板子进行更改

编译

sudo make -j8 #j后面跟的是自己板子的cpu核数,xavier为8核

./darknet 

若输出usage: ./darknet 则安装成功

测试

图片

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

视频

./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights <video file>

权重
密码:t76q

猜你喜欢

转载自blog.csdn.net/qq_35608277/article/details/110132992