NVIDIA Jetson Nano學習筆記(九):安裝Darknet環境(YOLOv3 / YOLOv4)

安裝OpenCV

# 若後續會用到YOLOv5請透過以下連結的指令安裝(原因):

編譯Darknet

在編譯darknet之後遇到 error while loading shared libraries: libopencv_highgui.so.X.X: cannot open,請先參考下文進行編譯

$ git clone https://github.com/AlexeyAB/darknet.git
$ cd darknet
$ nano MakefileGPU=1
CUDNN=1
CUDNN_HALF=1
OPENCV=1
AVX=0
OPENMP=1
LIBSO=1
ZED_CAMERA=0
ZED_CAMERA_v2_8=0

......

USE_CPP=0
DEBUG=0

ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]
$ make$ wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights#使用Webcam偵測
$ ./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights -c 0
#使用CSI Camera偵測
$ ./darknet detector demo data/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights " nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e

參考資料

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store