I'm trying to add a new block in yolov7. I want to multiply the output of this block with the previous layer coming from other layer.
I used mul (previous and output), but how can I modify in order to precise this two layers in YAML file.
I'm trying to add a new block in yolov7. I want to multiply the output of this block with the previous layer coming from other layer.
I used mul (previous and output), but how can I modify in order to precise this two layers in YAML file.
in yolo.py
elif m is Multiply:
c2 = ch[f[0]]
common.py
class Multiply(nn.Module):
def __init__(self):
super(Multiply, self).__init__()
def forward(self, x):
return torch.mul(x[0], x[1])
Yaml.file
nowfor example: [[-1, 6], 1, Multiply, []] # cat backbone P4