def __init__(self):
     self.sample_options = (
         # Do nothing
         None,
         # min IoU, max IoU
         (0.1, None),
         (0.3, None),
         (0.5, None),
         (0.7, None),
         (0.9, None),
         # no IoU requirements
         (None, None),
     )
     self.dboxes = dboxes640_coco()
    def __init__(self, backbone=None, num_classes=21):
        super(RetinaNet640, self).__init__()
        if backbone is None:
            raise Exception("backbone is None")
        if not hasattr(backbone, "out_channels"):
            raise Exception("the backbone not has attribute: out_channel")
        self.feature_extractor = backbone

        self.num_classes = num_classes
        # out_channels = [1024, 512, 512, 256, 256, 256] for resnet50
        self.predictor = Predictor(num_features=5,
                                   in_channels=256,
                                   num_layers_before_predictor=4,
                                   num_classes=num_classes,
                                   num_boxes=6)

        default_box = dboxes640_coco()
        self.compute_loss = Loss(default_box)
        self.encoder = Encoder(default_box)
        self.postprocess = PostProcess(default_box)
 def __init__(self):
     self.default_box = dboxes640_coco()
     self.encoder = Encoder(self.default_box)