Skip to content

Commit

Permalink
yapf reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
aash1999 committed Oct 25, 2023
1 parent 1f85ade commit 8738c27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ def __init__(self, weights='yolov5s.pt', device=torch.device('cpu'), dnn=False,
model.half() if fp16 else model.float()
if extra_files['config.txt']: # load metadata dict
d = json.loads(extra_files['config.txt'],
object_hook=lambda d: {int(k) if k.isdigit() else k: v
for k, v in d.items()})
object_hook=lambda d: {
int(k) if k.isdigit() else k: v
for k, v in d.items()})
stride, names = int(d['stride']), d['names']
elif dnn: # ONNX OpenCV DNN
LOGGER.info(f'Loading {w} for ONNX OpenCV DNN inference...')
Expand Down Expand Up @@ -884,6 +885,7 @@ def forward(self, x):

# contributed by @aash1999
class ChannelAttention(nn.Module):

def __init__(self, in_planes, ratio=16):
"""
Initialize the Channel Attention module.
Expand Down Expand Up @@ -920,6 +922,7 @@ def forward(self, x):

# contributed by @aash1999
class SpatialAttention(nn.Module):

def __init__(self, kernel_size=7):
"""
Initialize the Spatial Attention module.
Expand Down Expand Up @@ -996,6 +999,7 @@ def forward(self, x):

# contributed by @aash1999
class Involution(nn.Module):

def __init__(self, c1, c2, kernel_size, stride):
"""
Initialize the Involution module.
Expand Down

0 comments on commit 8738c27

Please sign in to comment.