WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.15k stars 4.16k forks source link

question about E-ELAN structure and Re-parameterized #339

Open wssywh opened 2 years ago

wssywh commented 2 years ago

Question1: The E-ELAN structure given in the paper is different from that in the code. The flow chart on the right of the following figure is drawn according to the structure in yolov7e6e.yaml, which is quite different from the E-ELAN structure in the paper. There is no shuffle and no group convolution. imageimage

[-1, 1, Conv, [64, 1, 1]], [-2, 1, Conv, [64, 1, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [[-1, -3, -5, -7, -8], 1, Concat, [1]], [-1, 1, Conv, [160, 1, 1]], # 12 [-11, 1, Conv, [64, 1, 1]], [-12, 1, Conv, [64, 1, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [-1, 1, Conv, [64, 3, 1]], [[-1, -3, -5, -7, -8], 1, Concat, [1]], [-1, 1, Conv, [160, 1, 1]], # 22 [[-1, -11], 1, Shortcut, [1]], # 23

Question2: Re-parameterized convolution only appears in yolov.yaml, and is only used in the detection head. It is not used in ELAN structure and backbone, and is not used in other models. [75, 1, RepConv, [256, 3, 1]], [88, 1, RepConv, [512, 3, 1]], [101, 1, RepConv, [1024, 3, 1]],

Question3: YOLOv7-E6E reparameterization just sets the weight of lead head to 0, and then copies the weight of aux had. Why do you need this operation? Why this operation is reparameterization? image

WongKinYiu commented 2 years ago

A1: they are equivalence architecture.

A2: we perform reparameterization on conv-bn, repconv, orepa, and yolor.

A3: training with auxiliary head, and strip auxiliary head at inference time is also a kind of reparameterization.

LeonNerd commented 2 years ago

A1: they are equivalence architecture.

A2: we perform reparameterization on conv-bn, repconv, orepa, and yolor.

A3: training with auxiliary head, and strip auxiliary head at inference time is also a kind of reparameterization.

Hello, about A2, I see that the sample program is only used in the detection head, and must trained by cfg/training/.yaml, reparameterized model in cfg/deploy/.yaml. So, if i want to transfer the backbone to my project (i.e.FairMOT), what should i do? Thanks.

LaCandela commented 1 year ago

A1: they are equivalence architecture.

A2: we perform reparameterization on conv-bn, repconv, orepa, and yolor.

A3: training with auxiliary head, and strip auxiliary head at inference time is also a kind of reparameterization.

@WongKinYiu I am having a similar question. I cannot find the expand, shuffle and merge cardinality in code and the network based on the configuration files seems different than what you can find in the paper. Can you explain what do you mean by that concepts in the code and in the paper are equivalent?

One more thing. If I understand correctly, ELAN is based on CSP concept. However, I can only see onelayer that has CSP structure in the head (SPPCSPC). Is this the only part that uses CSP concept. Moreover, the tiny model doesn't have any CSP as I can see, does it still have ELAN backbone?

Thank you!

WongKinYiu commented 1 year ago

equivalence architecture is shown in page 16 figure a3.

you could find description of elan in elan paper.