-1

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.

enter image description here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

1 Answers1

0
  1. You should add this lines in yolo.py
elif m is Multiply:
    c2 = ch[f[0]]
  1. Add a class Multiply in common.py
class Multiply(nn.Module):
    def __init__(self):
        super(Multiply, self).__init__()

    def forward(self, x):
        return torch.mul(x[0], x[1])
  1. Add in Yaml.file now
for example: [[-1, 6], 1, Multiply, []]  # cat backbone P4 
user16217248
  • 3,119
  • 19
  • 19
  • 37