def __init__(self, min_cls_score=0.4, min_ap_dist=0.64, max_time_lost=30, use_tracking=True, use_refind=True, models={}, configs={}): self.models = models self.configs = configs self.min_cls_score = min_cls_score self.min_ap_dist = min_ap_dist self.max_time_lost = max_time_lost self.kalman_filter = KalmanFilter() self.tracked_stracks = [] # type: list[STrack] self.lost_stracks = [] # type: list[STrack] self.removed_stracks = [] # type: list[STrack] self.use_refind = use_refind self.use_tracking = use_tracking self.classifier = PatchClassifier() self.reid_model = load_reid_model() self.frame_id = 0
def __init__(self, **kwargs): self.min_cls_score = kwargs['tracker_min_cls_score'] self.min_ap_dist = kwargs['tracker_min_ap_dist'] self.max_time_lost = kwargs['tracker_max_time_lost'] self.kalman_filter = KalmanFilter() self.tracked_stracks = [] # type: list[STrack] self.lost_stracks = [] # type: list[STrack] self.removed_stracks = [] # type: list[STrack] self.use_refind = not kwargs['tracker_no_refind'] self.use_tracking = not kwargs['tracker_no_tracking'] self.classifier = PatchClassifier( ckpt=kwargs['tracker_squeezenet_ckpt']) self.reid_model = load_reid_model( ckpt=kwargs['tracker_googlenet_ckpt']) self.frame_id = 0
def __init__(self, min_cls_score=0.4, min_ap_dist=0.64, max_time_lost=30, use_tracking=True, use_refind=True, metric_net=False, ide=False): self.min_cls_score = min_cls_score self.min_ap_dist = min_ap_dist self.max_time_lost = max_time_lost self.kalman_filter = KalmanFilter() self.tracked_stracks = [] # type: list[STrack] self.lost_stracks = [] # type: list[STrack] self.removed_stracks = [] # type: list[STrack] self.use_refind = use_refind self.use_tracking = use_tracking self.classifier = PatchClassifier() self.reid_model = load_reid_model(ide=ide) if ide: self.min_ap_dist = 25 if metric_net: self.metric_net = MetricNet(feature_dim=512 if not ide else 256, num_class=2).cuda() checkpoint = torch.load( '/home/houyz/Code/DeepCC/src/hyper_score/logs/1fps_train_IDE_40/GT/metric_net_L2_1200.pth.tar' ) model_dict = checkpoint['state_dict'] self.metric_net.load_state_dict(model_dict) self.metric_net.eval() self.min_ap_dist = 1 else: self.metric_net = None self.frame_id = 0
def __init__(self, cam, ide=False): self.reid_model = load_reid_model(ide=ide) self.frame_id = 0 self.cam = cam self.lines = np.array([]).reshape(0, (512 if not ide else 256) + 3)