Yolo的tensorflow版本 https://github.com/ruiminshen/yolo-tf
YoloV2的windows版本 https://github.com/AlexeyAB/darknet
YOLO v2之总结篇(linux+windows) 点击打开链接
yolo 在windows下的配置http://blog.csdn.net/desert961467/article/details/78200787
ruiminshen/yolo2-pytorch: PyTorch implementation of the YOLO (You Only Look Once) v2
https://github.com/ruiminshen/yolo2-pytorch
如何使用:
Example of usage in cmd-files from build\darknet\x64\
:
darknet_voc.cmd
- initialization with 194 MB VOC-model yolo-voc.weights & yolo-voc.cfg and waiting for entering the name of the image filedarknet_demo_voc.cmd
- initialization with 194 MB VOC-model yolo-voc.weights & yolo-voc.cfg and play your video file which you must rename to: test.mp4darknet_demo_store.cmd
- initialization with 194 MB VOC-model yolo-voc.weights & yolo-voc.cfg and play your video file which you must rename to: test.mp4, and store result to: res.avidarknet_net_cam_voc.cmd
- initialization with 194 MB VOC-model, play video from network video-camera mjpeg-stream (also from you phone)darknet_web_cam_voc.cmd
- initialization with 194 MB VOC-model, play video from Web-Camera number #0darknet_coco_9000.cmd
- initialization with 186 MB Yolo9000 COCO-model, and show detection on the image: dog.jpgdarknet_coco_9000_demo.cmd
- initialization with 186 MB Yolo9000 COCO-model, and show detection on the video (if it is present): street4k.mp4, and store result to: res.avi
命令行形式:
On Linux use ./darknet
instead of darknet.exe
, like this:./darknet detector test ./cfg/coco.data ./cfg/yolo.cfg ./yolo.weights
- 194 MB COCO-model - image:
darknet.exe detector test data/coco.data yolo.cfg yolo.weights -i 0 -thresh 0.2
- Alternative method 194 MB COCO-model - image:
darknet.exe detect yolo.cfg yolo.weights -i 0 -thresh 0.2
- 194 MB VOC-model - image:
darknet.exe detector test data/voc.data yolo-voc.cfg yolo-voc.weights -i 0
- 194 MB COCO-model - video:
darknet.exe detector demo data/coco.data yolo.cfg yolo.weights test.mp4 -i 0
- 194 MB VOC-model - video:
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 -i 0
- 194 MB COCO-model - save result to the file res.avi:
darknet.exe detector demo data/coco.data yolo.cfg yolo.weights test.mp4 -i 0 -out_filename res.avi
- 194 MB VOC-model - save result to the file res.avi:
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4 -i 0 -out_filename res.avi
- Alternative method 194 MB VOC-model - video:
darknet.exe yolo demo yolo-voc.cfg yolo-voc.weights test.mp4 -i 0
- 60 MB VOC-model for video:
darknet.exe detector demo data/voc.data tiny-yolo-voc.cfg tiny-yolo-voc.weights test.mp4 -i 0
- 194 MB COCO-model for net-videocam - Smart WebCam:
darknet.exe detector demo data/coco.data yolo.cfg yolo.weights http://192.168.0.80:8080/video?dummy=param.mjpg -i 0
- 194 MB VOC-model for net-videocam - Smart WebCam:
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights http://192.168.0.80:8080/video?dummy=param.mjpg -i 0
- 194 MB VOC-model - WebCamera #0:
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights -c 0
- 186 MB Yolo9000 - image:
darknet.exe detector test cfg/combine9k.data yolo9000.cfg yolo9000.weights
- 186 MB Yolo9000 - video:
darknet.exe detector demo cfg/combine9k.data yolo9000.cfg yolo9000.weights test.mp4
- Remeber to put data/9k.tree and data/coco9k.map under the same folder of your app if you use the cpp api to build an app
- To process a list of images
data/train.txt
and save results of detection toresult.txt
use:darknet.exe detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show < data/train.txt > result.txt
You can comment this line so that each image does not require pressing the button ESC: https://github.com/AlexeyAB/darknet/blob/6ccb41808caf753feea58ca9df79d6367dedc434/src/detector.c#L509
使用安卓智能手机,用网络视频流For using network video-camera mjpeg-stream with any Android smartphone:
Download for Android phone mjpeg-stream soft: IP Webcam / Smart WebCam
- Smart WebCam - preferably: https://play.google.com/store/apps/details?id=com.acontech.android.SmartWebCam2
- IP Webcam: https://play.google.com/store/apps/details?id=com.pas.webcam
Connect your Android phone to computer by WiFi (through a WiFi-router) or USB
Start Smart WebCam on your phone
Replace the address below, on shown in the phone application (Smart WebCam) and launch:
- 194 MB COCO-model:
darknet.exe detector demo data/coco.data yolo.cfg yolo.weights http://192.168.0.80:8080/video?dummy=param.mjpg -i 0
- 194 MB VOC-model:
darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights http://192.168.0.80:8080/video?dummy=param.mjpg -i 0
----------------------------------------------------------------------------------------------------------------------------
从Windows生成的文件中又有以下命令格式
calc_anchors.cmd: How to calculate Yolo v2 anchors using K-means++
darknet.exe detector calc_anchors data/voc.data -num_of_clusters 5 -final_width 13 -final_heigh 13
--------------------------------------------------------------------------------------------------------------------------
calc_mAP.cmd
How to calculate mAP (mean average precision)
darknet.exe detector map data/voc.data tiny-yolo-voc.cfg tiny-yolo-voc.weights
darknet.exe detector map data/voc.data yolo-voc.cfg yolo-voc.weights
----------------------------------------------------------------------------------------------------------------------------
calc_mAP_voc_py.cmd
C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install numpy
C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install cPickle
C:\Users\Alex\AppData\Local\Programs\Python\Python36\Scripts\pip install _pickle
darknet.exe detector valid data/voc.data tiny-yolo-voc.cfg tiny-yolo-voc.weights
darknet.exe detector valid data/voc.data yolo-voc.cfg yolo-voc.weights
reval_voc_py3.py --year 2007 --classes data\voc.names --image_set test --voc_dir E:\VOC2007_2012\VOCtrainval_11-May-2012\VOCdevkit results
-----------------------------------------------------------------------------------------------------------------------------
classifier_densenet201.cmd
REM Download weights for DenseNet201 and ResNet50 by this link: https://pjreddie.com/darknet/imagenet/
-----------------------------------------------------------------------------------------------------------------------------
classifier_resnet50.cmd
darknet.exe classifier predict cfg/imagenet1k.data cfg/resnet50.cfg resnet50.weights
darknet.exe classifier predict cfg/imagenet1k.data cfg/resnet152.cfg resnet152.weights
REM Download weights for DenseNet201, ResNet50 and ResNet152 by this link: https://pjreddie.com/darknet/imagenet/
----------------------------------------------------------------------------------------------------------------------------