当前位置: 首页>>代码示例>>Python>>正文


Python tracker.Tracker方法代码示例

本文整理汇总了Python中deep_sort.tracker.Tracker方法的典型用法代码示例。如果您正苦于以下问题:Python tracker.Tracker方法的具体用法?Python tracker.Tracker怎么用?Python tracker.Tracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在deep_sort.tracker的用法示例。


在下文中一共展示了tracker.Tracker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from deep_sort import tracker [as 别名]
# 或者: from deep_sort.tracker import Tracker [as 别名]
def __init__(self, mode):
        self.mode = mode
        self.conf = capture_conf.env[mode]
        self.init_sources(self.conf.source_paths)
        self.detector = Predict.instance()
        self.trackers = [Tracker(nn_matching.NearestNeighborDistanceMetric("cosine", self.conf.track_max_cosine_distance, self.conf.track_nn_budget),
                                 max_iou_distance=self.conf.track_max_iou_distance,
                                 max_age=self.conf.track_max_age,
                                 n_init=self.conf.track_n_init)
                         for _ in self.sources_parsed]
        self.track_pool = new_pools(self.conf.pool_size)
        self.save_pool = new_pools(self.conf.pool_size)
        self.frame_index = 0
        self.video_state = False
        if self.conf.video_on:
            self.box_queue = queue.LifoQueue(100)
            if self.conf.is_async:
                submit(self.video_on)
        self.debug = mode == 'dev'
        if self.debug:
            self.last_time = datetime.now()
            self.fps = 0
            self.pids = set() 
开发者ID:Kestrong,项目名称:capture_reid,代码行数:25,代码来源:main.py

示例2: __init__

# 需要导入模块: from deep_sort import tracker [as 别名]
# 或者: from deep_sort.tracker import Tracker [as 别名]
def __init__(self, timesteps=32):
        self.active_actors = []
        self.inactive_actors = []
        self.actor_no = 0
        self.frame_history = []
        self.frame_no = 0
        self.timesteps = timesteps
        self.actor_infos = {}
        # deep sort
        self.encoder = create_box_encoder(MODEL_CKPT, batch_size=16)
        metric = nn_matching.NearestNeighborDistanceMetric("cosine", 0.2, None) #, max_cosine_distance=0.2) #, nn_budget=None)
        #self.tracker = ds_Tracker(metric, max_iou_distance=0.7, max_age=30, n_init=3)
        #self.tracker = ds_Tracker(metric, max_iou_distance=0.7, max_age=200, n_init=1)
        self.tracker = ds_Tracker(metric, max_iou_distance=0.7, max_age=200, n_init=5)
        self.score_th = 0.40
        #self.results = []

    # def add_frame(self, frame):
    #     ''' Adds a new frame to the history.
    #         This is used when we dont want to run the obj detection and traking but want to keep the frames
    #         for action detection. 
    #     '''
    #     H,W,C = frame.shape
    #     #initialize first
    #     if not self.frame_history:
    #         for _ in range(self.timesteps):
    #             self.frame_history.append(np.zeros([H,W,C], np.uint8))
    #     del self.frame_history[0]
    #     self.frame_history.append(frame)
    #     # if len(self.frame_history) == self.timesteps:
    #     #     del self.frame_history[0]
    #     #     self.frame_history.append(frame)
    #     # else:
    #     #     self.frame_history.append(frame)

    #     self.frame_no += 1 
开发者ID:oulutan,项目名称:ACAM_Demo,代码行数:38,代码来源:object_detector.py


注:本文中的deep_sort.tracker.Tracker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。