Darknet-YOLO 배치 커맨드 사용법
Darknet 설치를 마쳤다면 아래의 몇 가지를 테스트 할 수 있고 테스트 결과를 보며 신기해 할 수 있다.
Darknet에서는 80개의 사물을 구분하는 coco data 학습해 놓은 weights 파일을 제공하고 있다. 그것을 이용해서 Darknet의 사용법과 성능에 대해 이해할 수 있다.
Darknet 설치를 마치고 빌드를 했다면 darknet.exe이 있는 경로에 다양한 cmd 파일들이 있다. 그것들을 실행시키면 미리 학습된 weights 로 여러가지 파일 포맷을 사용해서 물체감지 하는 모습을 구경 할 수 있다.
단일이미지는 물론 복수의 이미지, 동영상, 심지어 IP 카메라로도 테스트 할 수 있다.
아래는 Darknet 설명과 코드가 있는 출처이다.
링크 -> https://github.com/AlexeyAB/darknet
아래는 커맨드에 대한 예시와 사용방법이다.
1. darknet.exe detector test data/coco.data cfg/yolov3.cfg yolov3.weights -i 0 -thresh 0.25
test : 이미지 한 장 테스트를 위한 커맨드
data/coco.data : data폴더의 coco.data 파일을 이용
cfg/yolov3.cfg : 레이어의 정보가 들어있는 파일
yolov3.weights : 학습된 가중치(여기서는 coco.data에 대해 미리 학습된 가중치이다.)
thresh : 임계값(0.25는 25%이상 정확도의 물체만 감지한다는 뜻)
i : ?(추가 예정)
2. darknet.exe detector test data/coco.data yolov3.cfg yolov3.weights -ext_output dog.jpg
ext_output dog.jpg : 결과물 저장파일 dog.jpg를 출력한다.
3. darknet.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights -ext_output test.mp4
demo : 동영상 파일 테스트를 위한 커맨드
4. darknet.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights -c 0
-c 0 : 0번 웹캠 테스트를 위한 커맨드
5. arknet.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights http://192.168.0.80:8080/video?dummy=param.mjpg
http://192.168.0.80:8080/video?dummy=param.mjpg : 아이피 카메라 주소
6. arknet.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights -thresh 0.25 test.mp4 -out_filename res.avi
: test.mp4 파일을 테스트 하고 그 결과를 res.avi로 출력한다.
7. darknet.exe detector test cfg/coco.data yolov3.cfg yolov3.weights -dont_show -ext_output < data/train.txt > result.txt
이미지 리스트가 적혀있는 train.txt의 이미지 목록을 읽고 그 목록에 있는 이미지를 테스트 해 result.txt에 출력한다.
'Deep Learning > Darknet' 카테고리의 다른 글
[Darknet YOLO] 데이터 파일 정리 - 3 (0) | 2018.12.18 |
---|---|
[Darknet yolo]yolo를 이용한 물체감지(Object Detection) 튜토리얼 (3) | 2018.12.16 |