def faster_rcnn_resnet50_fpn() -> nn.Module: weights_url = ( "https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_coco-258fb6c6.pth" ) model = faster_rcnn.model(num_classes=NUM_CLASSES) load_model_weights_from_url(model=model, url=weights_url) return model
def mask_rcnn_resnet50_fpn() -> nn.Module: # weights_url = "https://github.com/airctic/icedata/releases/download/m1/pennfudan_maskrcnn_resnet50_fpn.zip" weights_url = "https://github.com/airctic/model_zoo/releases/download/pennfudan_maskrcnn_resnet50fpn/pennfudan_maskrcnn_resnet50fpn.zip" model = mask_rcnn.model(num_classes=NUM_CLASSES) load_model_weights_from_url(model=model, url=weights_url) return model
def _load_efficientdet(name, weights_url): model = efficientdet.model(name, num_classes=NUM_CLASSES, img_size=512) load_model_weights_from_url(model, weights_url) return model
def _load_faster_rcnn(backbone, weights_url): model = faster_rcnn.model(num_classes=NUM_CLASSES, backbone=backbone) load_model_weights_from_url(model=model, url=weights_url) return model
def _load_efficientdet(backbone, weights_url): model = models.ross.efficientdet.model(backbone=backbone(pretrained=False), num_classes=NUM_CLASSES, img_size=384) load_model_weights_from_url(model, weights_url) return model