资源简介
此为用pysot里面的vot功能DIMP50要用到的修改后的tracker.py文件
代码片段和文件信息
import importlib
import os
import numpy as np
from collections import OrderedDict
from pytracking.evaluation.environment import env_settings
import time
import cv2 as cv
from pytracking.utils.visdom import Visdom
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from pytracking.utils.plotting import draw_figure overlay_mask
from pytracking.utils.convert_vot_anno_to_rect import convert_vot_anno_to_rect
from ltr.data.bounding_box_utils import masks_to_bboxes
from pytracking.evaluation.multi_object_wrapper import MultiobjectWrapper
from pytracking.vot_utils.region import vot_overlap
from pathlib import Path
import torch
import warnings
warnings.filterwarnings(‘ignore‘)
_tracker_disp_colors = {1: (0 255 0) 2: (0 0 255) 3: (255 0 0)
4: (255 255 255) 5: (0 0 0) 6: (0 255 128)
7: (123 123 123) 8: (255 128 0) 9: (128 0 255)}
def trackerlist(name: str parameter_name: str run_ids = None display_name: str = None):
“““Generate list of trackers.
args:
name: Name of tracking method.
parameter_name: Name of parameter file.
run_ids: A single or list of run_ids.
display_name: Name to be displayed in the result plots.
“““
if run_ids is None or isinstance(run_ids int):
run_ids = [run_ids]
return [Tracker(name parameter_name run_id display_name) for run_id in run_ids]
class Tracker:
“““Wraps the tracker for evaluation and running purposes.
args:
name: Name of tracking method.
parameter_name: Name of parameter file.
run_id: The run id.
display_name: Name to be displayed in the result plots.
“““
def __init__(self name: str parameter_name: str run_id: int = None display_name: str = None):
assert run_id is None or isinstance(run_id int)
self.name = name
self.parameter_name = parameter_name
self.run_id = run_id
self.display_name = display_name
env = env_settings()
if self.run_id is None:
self.results_dir = ‘{}/{}/{}‘.format(env.results_path self.name self.parameter_name)
self.segmentation_dir = ‘{}/{}/{}‘.format(env.segmentation_path self.name self.parameter_name)
else:
self.results_dir = ‘{}/{}/{}_{:03d}‘.format(env.results_path self.name self.parameter_name self.run_id)
self.segmentation_dir = ‘{}/{}/{}_{:03d}‘.format(env.segmentation_path self.name self.parameter_name self.run_id)
tracker_module_abspath = os.path.abspath(os.path.join(os.path.dirname(__file__) ‘..‘ ‘tracker‘ self.name))
if os.path.isdir(tracker_module_abspath):
tracker_module = importlib.import_module(‘pytracking.tracker.{}‘.format(self.name))
self.tracker_class = tracker_module.get_tracker_class() # eg: class DIMP not yet initialize
else:
self.tracker_class = None
self.visdom = None
def
相关资源
- Python爬取教务系统课程表
- 元胞自动机模拟交通道路_Python
- Python二级考试试题.zip
- python实现扫描线填充算法,可以画凹
- python3 包装的httpclient,支持session
- python日期时间运算
- python实现的ping工具
- Python简版聊天室代码
- Flask-login
- 矩阵分解在MovieLens上的Python实现
- 全国840个气象站点日照时数转日总太
- python 3.6 socket传输视频
- 基于PYQT编写的人脸识别软件
- 续Python3.x+PyQtChart实现数据可视化界面
- 疯狂Python讲义习题答案.rar
- A*算法解决十五数码问题Python程序、报
- 使用python tkinter写的登陆窗口源码
- caffe_pb2.py
- LUTAI.Tools.IronPythonCheckTool
- 基于python的猜单词游戏开发
- 基于Python实现的Pagerank算法
- Python实现数据库
- 传智播客Python就业班2018.zip
- Python对爬取微博的评论进行jieba分词和
- python爬虫 破解js加密有道词典案列的
- python写的旅游网站源码
- 利用鸢尾花数据集画出P-R曲线 pytho
- pyHook-1.5.1-cp38-cp38-win_amd64.whl
- freesmallgames.zip
- python一加云相册批量爬虫
评论
共有 条评论