Series
- Part 1: compile darknet on ubuntu 16.04
- Part 2: compile darknet on windows 10
- Part 3: compile caffe-yolov3 on ubuntu 16.04
Guide
requirements
my system requirements (same as caffe on ubuntu 16.04)
- ubuntu 16.04
- GeForce 1060 (6G) sm_61
- cuda: 9.2
- cudnn: 7.1.4
- opencv: 3.3.0
- caffe: latest
compile
1 | git clone https://github.com/kezunlin/caffe-yolov3.git |
caffe-yolov3
is based on caffe withUpsampleLayer
and darknet.
tips: edit CMakeLists.txt forcaffe
.
see CMakeLists.txt
make
1 | make -j8 |
demo
1 | cd install/bin |
output
num_inputs is 1
num_outputs is 3
I1211 17:13:30.259755 10384 detectnet.cpp:74] Input data layer channels is 3
I1211 17:13:30.259785 10384 detectnet.cpp:75] Input data layer width is 416
I1211 17:13:30.259806 10384 detectnet.cpp:76] Input data layer height is 416
output blob1 shape c= 255, h = 13, w = 13
output blob2 shape c= 255, h = 26, w = 26
output blob3 shape c= 255, h = 52, w = 52
object-detection: finished processing data operation (392)ms
object-detection: finished processing yolov3 network (135)ms
16: 99%
x = 0.288428,y = 0.660513,w = 0.243282,h = 0.543122
left = 128,right = 314,top = 224,bot = 536
7: 93%
x = 0.756588,y = 0.222789,w = 0.280549,h = 0.147772
left = 473,right = 688,top = 85,bot = 170
1: 99%
x = 0.473371,y = 0.483899,w = 0.517509,h = 0.575438
left = 164,right = 562,top = 112,bot = 444
detectnet-camera: video device has been un-initialized.
detectnet-camera: this concludes the test of the video device.
image
net
input && output
input:
- data 1,3,416,416
output
- layer82-conv 1,255,13,13
- layer94-conv 1,255,26,26
- layer106-conv 1,255,52,52
python code
1 | ### Input: the model's output dict |
yolov3 model
darknet
files
- yolov3.weights
- yolov3.cfg
- coco.names
caffe-yolov3
files
- yolov3.caffemodel
- yolov3.prototxt
- coco.names
- yolov3-cpp.prototxt
- yolov3-trt.prototxt
yolov3-cpp.prototxt
compared with yolov3.prototxt
1 | layer { |
Use
Yolov3DetectionOutput
layer withcaffe
(Upsample
+Yolov3DetectionOutput
)
yolov3-trt.prototxt
see yolov3-trt.prototxt
compared with yolov3-cpp.prototxt
1 | layer { |
Use
YoloLayerPlugin
plugin withTensorRT
caffe extension layer
UpsampleLayer
Yolov3DetectionOutputLayer
- proto: caffe.proto
- yolov3_detection_output_layer.hpp: header
- yolov3_detection_output_layer.cpp: cpp
yolov3 with tensorrt
Reference
History
- 20181211: created.