Feature-request: State-of-art Yolo v4 Detector
- paper: https://arxiv.org/abs/2004.10934
- source code: https://github.com/AlexeyAB/darknet
- cfg-file Yolov4: https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4.cfg
- weights-file Yolov4: https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT
Many other features from Darknet were added previously.
But should be added at least new two features:
- Mish-activation:
float softplus(float x, float threshold = 20) {
if (x > threshold) return x; // too large
else if (x < -threshold) return expf(x); // too small
return logf(expf(x) + 1);
}
float mish_activation(float input) {
const float MISH_THRESHOLD = 20;
output = input * tanh( softplus(input, MISH_THRESHOLD) );
return output;
}
- Eliminate grid sensitivity – by using
scale_x_y=
parameter from[yolo]
layer in cfg-file (by default usescale_x_y=1.0
if the value is not set in cfg file)
we should use:
const float x_tmp = logistic_activate(srcData[box_index + 0]) * scale_x_y - (scale_x_y - 1) / 2;
const float y_tmp = logistic_activate(srcData[box_index + 1]) * scale_x_y - (scale_x_y - 1) / 2;
dstData[box_index + 0] = (x + x_tmp)) / cols;
dstData[box_index + 1] = (y + y_tmp)) / rows;
instead of
opencv/modules/dnn/src/layers/region_layer.cpp
Lines 305 to 306
in
51a42c0
Comparison of detectors on Microsoft COCO dataset and Tesla V100 GPU:
Hi! PR #17185 with Yolo v4 support has been merged to 3.4 branch