def get_model(cfg): cfg.merge_from_file('../configs/second/car.yaml') anchors = AnchorGenerator(cfg).anchors preprocessor = Preprocessor(cfg) model = Second(cfg).cuda().eval() ckpt = torch.load('../pvrcnn/ckpts/epoch_12.pth')['state_dict'] model.load_state_dict(ckpt, strict=True) return model, preprocessor, anchors
def __init__(self,): self.cfg = cfg self.cfg.merge_from_file('../configs/second/car.yaml') self.preprocessor = Preprocessor(cfg) self.anchors = AnchorGenerator(cfg).anchors.cuda() self.net = PV_RCNN(cfg).cuda().eval() # self.net = Second(cfg).cuda().eval() ckpt = torch.load('./ckpts/epoch_49.pth') self.net.load_state_dict(ckpt['state_dict']) pass
def __init__(self, cfg, split): super(KittiDataset, self).__init__() self.split = split self.rootdir = cfg.DATA.ROOTDIR self.load_annotations(cfg) if split == 'train': anchors = AnchorGenerator(cfg).anchors self.target_assigner = ProposalTargetAssigner(cfg, anchors) self.augmentation = ChainedAugmentation(cfg) self.cfg = cfg
def __init__(self, cfg): super(KittiDatasetTrain, self).__init__(cfg, split='train') anchors = AnchorGenerator(cfg).anchors DatabaseBuilder(cfg, self.annotations) self.target_assigner = ProposalTargetAssigner(cfg, anchors) self.augmentation = ChainedAugmentation(cfg)