*.torchscript inference self.jit fix (#6007)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-12-16 14:10:54 +01:00
1 parent 628817dfae
commit c1249a47c7
1 file changed
+1 -1
+1 -1
View File
@@ -379,7 +379,7 @@ class DetectMultiBackend(nn.Module):
def forward(self, im, augment=False, visualize=False, val=False):
# YOLOv5 MultiBackend inference
b, ch, h, w = im.shape # batch, channel, height, width
if self.pt: # PyTorch
if self.pt or self.jit: # PyTorch
y = self.model(im) if self.jit else self.model(im, augment=augment, visualize=visualize)
return y if val else y[0]
elif self.coreml: # CoreML