윈도우 환경에서 YOLO 세팅하기
목차
1. CUDA, cudnn 설치
2. OpenCV 설치
3. darknet 설치 및 환경 세팅
4. 간단한 예제 실행
0. 나의 환경
OS: Windows 10
Graphic Card: GForce GTX 1660 Super
CUDA: 10.2
cuDNN: 7.6.5
Visual Studio 2019
1. CUDA 10.2 , cuDNN v7.6.5 설치
그래픽카드가 GTX 1660 Super이기 때문에 CUDA 10.2 버전을 사용하였다.
Compute capability에 따라 설치할 수 있는 CUDA 버전이 있는데, CUDA 10.2 버전은 Compute capability 3.0~7.5 만을 지원한다.
CUDA SDK 10.0 – 10.2 support for compute capability 3.0 – 7.5 (Kepler, Maxwell, Pascal, Volta, Turing). Last version with support for compute capability 3.x (Kepler). 10.2 is the last official release for macOS, as support will not be available for macOS in newer releases.
여기에서 Computer capability 확인가능 ▶ https://en.wikipedia.org/wiki/CUDA
CUDA - Wikipedia
From Wikipedia, the free encyclopedia Jump to navigation Jump to search Parallel computing platform and programming model CUDA (an acronym for Compute Unified Device Architecture) is a parallel computing platform and application programming interface (API)
en.wikipedia.org
아래 페이지에 들어가서 알맞는 버전의 CUDA를 다운로드하고 설치해준다.
▶ https://developer.nvidia.com/cuda-toolkit-archive
CUDA Toolkit Archive
Previous releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production
developer.nvidia.com
다운로드가 완료되었으면 cuDNN을 설치한다. NVIDIA 회원가입 후 로그인 된 상태에서 가능하다.
CUDA 버전과 상용하는 cuDNN 다운로드 및 설치해준다.
▶ https://developer.nvidia.com/rdp/cudnn-archive
cuDNN Archive
NVIDIA cuDNN is a GPU-accelerated library of primitives for deep neural networks.
developer.nvidia.com
2. OpenCV 4.1.0 설치
▶ https://opencv.org/releases/page/3/
Releases - OpenCV
Become a Member Stay up to date on OpenCV and Computer Vision news Join our Newsletter
opencv.org
▶ https://github.com/opencv/opencv_contrib
opencv/opencv_contrib
Repository for OpenCV's extra modules. Contribute to opencv/opencv_contrib development by creating an account on GitHub.
github.com
OpenCV 4.1.0 과 OpenCV contrib을 다운받고 CMake로 Configuration해준다.
그후, Visual Studio로 OpenCV를 빌드해주고 Release한다.
3. darknet 설치 및 환경 세팅
darknet 파일을 받아주고 압축을 풀어준다.
▶ https://github.com/AlexeyAB/darknet
AlexeyAB/darknet
YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet ) - AlexeyAB/darknet
github.com
darknet 파일 내부 x64 폴더 내에 다음의 OpenCV, cnDNN 파일들을 복사해서 붙여넣는다
- OpenCV_ffmpeg410_64.dll
- OpenCV_world410.dll
- cndnn64_7.dll
darknet.vcxproj / yolo_cpp_dll.vcxproj 파일을 Notepad++로 cudnn 버전에 맞게 수정해준다.
버전을 수정해준 다음, YOLOv4를 Compile한다.
다음으로 darknet을 build해주어야 하는데, 환경변수 설정은 다음 영상을 참고한다.
▶ https://www.youtube.com/watch?v=sUxAVpzZ8hU
4. 간단한 예제 실행
▶ https://pjreddie.com/media/files/yolov3.weights
우선 미리 훈련된 weights 파일을 다운받아서 darknet-master\build\darknet\x64 폴더안에 넣어준다.
폴더에 들어가서 빈 곳에 Shift + 오른쪽버튼을 누르면 PowerShell 창 열기가 뜨는데, 간단한 예제를 돌려보자.
'캡스톤디자인프로젝트B_스타트16' 카테고리의 다른 글
[6] Openpose로 Keypoints 추출 및 json 파일 받아오기 (0) | 2021.11.13 |
---|---|
[4] Windows 10으로 Yolo_mark labeling (1) | 2021.05.19 |
[2] 개발환경 & 프로그램 구성도 (0) | 2021.05.18 |
[1] Yolo와 Openpose를 이용한 아동폭력 사전탐지 시스템 개발배경 (0) | 2021.05.18 |