AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.95k forks source link

SAM in yolo v4 use sigmoid or mish? #5355

Closed vraivon closed 4 years ago

vraivon commented 4 years ago

According to the Fig.5 in paper, it shows that using sigmoid in SAM block, but in the config file it seems that mish is used. https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L122

WongKinYiu commented 4 years ago

Hello,

Provided yolov4.cfg does not have SAM block. image

an example of SAM block is as follow:

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=mish

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=logistic

[sam]
from=-2
vraivon commented 4 years ago

thank you so is this part in cfg is WRC?

WongKinYiu commented 4 years ago

No, Mish is just an activation function.

For more information about WRC, you can take a look https://github.com/AlexeyAB/darknet/issues/4662.

vraivon commented 4 years ago

I know mish is an activation. I compared yolov4 cfg with yolov3 ,and found there are some different in backbone's structure. If those diff is not WRC, is it CSP? Besides, modified pan seems not in this cfg as well.

WongKinYiu commented 4 years ago

yes, the backbone is csp.

CSPDarknet53: https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L30-L745

SPP: https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L771-L792

PAN: https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L747-L1155 top-down nodes of PAN: https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L829-L841 https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L894-L906 bottom-up nodes of PAN: https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L994-L995 https://github.com/AlexeyAB/darknet/blob/6033baabc9d646b23d8dbdb21cf84663910dca60/cfg/yolov4-custom.cfg#L1081-L1082

vraivon commented 4 years ago

thank you so much

asagotra commented 4 years ago

Hi @AlexeyAB where to find this cfg file yolov4-sam-mish.cfg

WongKinYiu commented 4 years ago

https://hackmd.io/NFj2NrmqTcefjc2l94KjpQ?view

arunsagotra commented 4 years ago

Hi @WongKinYiu Thanks. I would like to ask how to implement conv_lstm in yolov4?