Skip to content

Commit

Permalink
update pretrained
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbliiiing committed Jul 8, 2022
1 parent 81de664 commit 2c470c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nets/CSPdarknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def __init__(self, base_channels, pretrained=False):
if pretrained:
phi = 'l'
url = {
"l" : 'https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/cspdarknet_backbone_l.pth',
"l" : 'https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/cspdarknet_backbone.pth',
}[phi]
checkpoint = torch.hub.load_state_dict_from_url(url=url, map_location="cpu", model_dir="./model_data")
self.load_state_dict(checkpoint, strict=False)
print("Load weights from ", url.split('/')[-1])
print("Load weights from " + url.split('/')[-1])

def forward(self, x):
x = self.stem(x)
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def download_weights(model_dir="./model_data"):

phi = "l"
download_urls = {
"l" : 'https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/cspdarknet_backbone_l.pth',
"l" : 'https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/cspdarknet_backbone.pth',
}
url = download_urls[phi]

Expand Down

0 comments on commit 2c470c7

Please sign in to comment.