retinanet_resnet50_fpn_coco-eeacb38b.pth
PyTorch RetinaNet
在线加载模型地址

确定自己使用的框架并导入对应的库。导入库实现样例代码可参考 文档中心-预训练模型使用教程

在代码中实现加载预训练模型地址

调用模型的实现方法

# 该版本retinanet来自torchvision,torchvision版本需大于0.8.0

import torch

from torchvision.models.detection import retinanet_resnet50_fpn

from flyai.utils import remote_helper

path = remote_helper.get_remote_date("https://www.flyai.com/m/retinanet_resnet50_fpn_coco-eeacb38b.pth")

model = retinanet_resnet50_fpn(pretrained=False)

model.load_state_dict(torch.load(path))

print(model)