vot-toolkit 0.7.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vot/__init__.py +136 -0
- vot/__main__.py +8 -0
- vot/analysis/__init__.py +574 -0
- vot/analysis/accuracy.py +418 -0
- vot/analysis/failures.py +98 -0
- vot/analysis/longterm.py +728 -0
- vot/analysis/multistart.py +441 -0
- vot/analysis/processor.py +915 -0
- vot/analysis/supervised.py +324 -0
- vot/analysis/tests.py +22 -0
- vot/dataset/__init__.py +1272 -0
- vot/dataset/common.py +351 -0
- vot/dataset/cow.png +0 -0
- vot/dataset/dummy.py +97 -0
- vot/dataset/got10k.py +128 -0
- vot/dataset/otb.py +230 -0
- vot/dataset/proxy.py +433 -0
- vot/dataset/trackingnet.py +122 -0
- vot/experiment/__init__.py +377 -0
- vot/experiment/helpers.py +53 -0
- vot/experiment/multirun.py +267 -0
- vot/experiment/multistart.py +126 -0
- vot/experiment/transformer.py +144 -0
- vot/region/__init__.py +146 -0
- vot/region/io.py +313 -0
- vot/region/raster.py +416 -0
- vot/region/shapes.py +507 -0
- vot/region/tests.py +104 -0
- vot/report/__init__.py +736 -0
- vot/report/commands.tex +16 -0
- vot/report/common.py +259 -0
- vot/report/html.py +199 -0
- vot/report/jquery.js +2 -0
- vot/report/latex.py +162 -0
- vot/report/pure.css +11 -0
- vot/report/report.css +153 -0
- vot/report/report.js +50 -0
- vot/report/table.js +280 -0
- vot/report/tests.py +0 -0
- vot/report/video.py +127 -0
- vot/stack/__init__.py +123 -0
- vot/stack/otb100.yaml +10 -0
- vot/stack/otb50.yaml +10 -0
- vot/stack/tests/basic.yaml +7 -0
- vot/stack/tests/multiobject.yaml +21 -0
- vot/stack/tests/segmentation.yaml +28 -0
- vot/stack/tests.py +33 -0
- vot/stack/vot2013.yaml +14 -0
- vot/stack/vot2014.yaml +14 -0
- vot/stack/vot2015/rgb.yaml +15 -0
- vot/stack/vot2015/tir.yaml +11 -0
- vot/stack/vot2016/rgb.yaml +21 -0
- vot/stack/vot2016/tir.yaml +11 -0
- vot/stack/vot2017.yaml +35 -0
- vot/stack/vot2018/longterm.yaml +20 -0
- vot/stack/vot2018/shortterm.yaml +33 -0
- vot/stack/vot2019/longterm.yaml +20 -0
- vot/stack/vot2019/rgbd.yaml +11 -0
- vot/stack/vot2019/rgbtir.yaml +15 -0
- vot/stack/vot2019/shortterm.yaml +33 -0
- vot/stack/vot2020/longterm.yaml +20 -0
- vot/stack/vot2020/rgbd.yaml +11 -0
- vot/stack/vot2020/rgbtir.yaml +15 -0
- vot/stack/vot2020/shortterm.yaml +37 -0
- vot/stack/vot2021/longterm.yaml +20 -0
- vot/stack/vot2021/rgbd.yaml +11 -0
- vot/stack/vot2021/shortterm.yaml +37 -0
- vot/stack/vot2022/depth.yaml +16 -0
- vot/stack/vot2022/longterm.yaml +20 -0
- vot/stack/vot2022/rgbd.yaml +16 -0
- vot/stack/vot2022/shortterm.yaml +37 -0
- vot/stack/vot2022/shorttermbox.yaml +37 -0
- vot/stack/vots2023.yaml +7 -0
- vot/stack/vots2024/main.yaml +7 -0
- vot/stack/vots2024/votst.yaml +7 -0
- vot/stack/vots2024/votstval.yaml +25 -0
- vot/stack/vots2025/main.yaml +7 -0
- vot/stack/vots2025/realtime.yaml +13 -0
- vot/stack/vots2025/votst.yaml +7 -0
- vot/tracker/__init__.py +924 -0
- vot/tracker/dummy.py +29 -0
- vot/tracker/results.py +305 -0
- vot/tracker/tests.py +20 -0
- vot/tracker/trax.py +809 -0
- vot/utilities/__init__.py +675 -0
- vot/utilities/cli.py +549 -0
- vot/utilities/data.py +198 -0
- vot/utilities/draw.py +283 -0
- vot/utilities/io.py +48 -0
- vot/utilities/migration.py +110 -0
- vot/utilities/net.py +239 -0
- vot/utilities/notebook.py +375 -0
- vot/version.py +4 -0
- vot/workspace/__init__.py +257 -0
- vot/workspace/storage.py +478 -0
- vot/workspace/tests.py +70 -0
- vot_toolkit-0.7.2.dist-info/LICENSE +674 -0
- vot_toolkit-0.7.2.dist-info/METADATA +82 -0
- vot_toolkit-0.7.2.dist-info/RECORD +102 -0
- vot_toolkit-0.7.2.dist-info/WHEEL +5 -0
- vot_toolkit-0.7.2.dist-info/entry_points.txt +46 -0
- vot_toolkit-0.7.2.dist-info/top_level.txt +1 -0
vot/__init__.py
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
""" Some basic functions and classes used by the toolkit. """
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
from .version import __version__
|
|
7
|
+
|
|
8
|
+
from lazy_object_proxy import Proxy
|
|
9
|
+
|
|
10
|
+
class ToolkitException(Exception):
|
|
11
|
+
"""Base class for all toolkit related exceptions
|
|
12
|
+
"""
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def toolkit_version() -> str:
|
|
17
|
+
"""Returns toolkit version as a string
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
str: Version of the toolkit
|
|
21
|
+
"""
|
|
22
|
+
return __version__
|
|
23
|
+
|
|
24
|
+
def check_updates() -> bool:
|
|
25
|
+
"""Checks for toolkit updates on Github, requires internet access, fails silently on errors.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
bool: True if an update is available, False otherwise.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
import re
|
|
32
|
+
import packaging.version as packaging
|
|
33
|
+
import requests
|
|
34
|
+
pattern = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
|
35
|
+
|
|
36
|
+
version_url = "https://github.com/votchallenge/vot-toolkit-python/raw/master/vot/version.py"
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
get_logger().debug("Checking for new version")
|
|
40
|
+
response = requests.get(version_url, timeout=5, allow_redirects=True)
|
|
41
|
+
except Exception as e:
|
|
42
|
+
get_logger().debug("Unable to retrieve version information %s", e)
|
|
43
|
+
return False, None
|
|
44
|
+
|
|
45
|
+
if not response:
|
|
46
|
+
return False, None
|
|
47
|
+
|
|
48
|
+
groups = re.search(pattern, response.content.decode("utf-8"), re.M)
|
|
49
|
+
if groups:
|
|
50
|
+
remote_version = packaging.parse(groups.group(1))
|
|
51
|
+
local_version = packaging.parse(__version__)
|
|
52
|
+
|
|
53
|
+
return remote_version > local_version, groups.group(1)
|
|
54
|
+
|
|
55
|
+
else:
|
|
56
|
+
return False, None
|
|
57
|
+
|
|
58
|
+
from attributee import Attributee, Integer, Boolean, List, String
|
|
59
|
+
|
|
60
|
+
class GlobalConfiguration(Attributee):
|
|
61
|
+
"""Global configuration object for the toolkit. It is used to store global configuration options. It can be initialized
|
|
62
|
+
from environment variables. The following options are supported:
|
|
63
|
+
|
|
64
|
+
- ``VOT_DEBUG_MODE``: Enables debug mode for the toolkit.
|
|
65
|
+
- ``VOT_SEQUENCE_CACHE_SIZE``: Maximum number of sequences to keep in cache.
|
|
66
|
+
- ``VOT_RESULTS_BINARY``: Enables binary results format.
|
|
67
|
+
- ``VOT_MASK_OPTIMIZE_READ``: Enables mask optimization when reading masks.
|
|
68
|
+
- ``VOT_WORKER_POOL_SIZE``: Number of workers to use for parallel processing.
|
|
69
|
+
- ``VOT_PERSISTENT_CACHE``: Enables persistent cache for analysis results in workspace.
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
debug_mode = Boolean(default=False, description="Enables debug mode for the toolkit.")
|
|
74
|
+
sequence_cache_size = Integer(default=100, description="Maximum number of sequences to keep in cache.")
|
|
75
|
+
results_binary = Boolean(default=True, description="Enables binary results format.")
|
|
76
|
+
mask_optimize_read = Boolean(default=True, description="Enables mask optimization when reading masks.")
|
|
77
|
+
worker_pool_size = Integer(default=1, description="Number of workers to use for parallel processing.")
|
|
78
|
+
persistent_cache = Boolean(default=True, description="Enables persistent cache for analysis results in workspace.")
|
|
79
|
+
registry = List(String(), default="", separator=os.pathsep, description="List of directories to search for tracker metadata.")
|
|
80
|
+
|
|
81
|
+
def __init__(self):
|
|
82
|
+
"""Initializes the global configuration object. It reads the configuration from environment variables.
|
|
83
|
+
|
|
84
|
+
Raises:
|
|
85
|
+
ValueError: When an invalid value is provided for an attribute.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = {}
|
|
89
|
+
for k in self.attributes():
|
|
90
|
+
envname = "VOT_{}".format(k.upper())
|
|
91
|
+
if envname in os.environ:
|
|
92
|
+
kwargs[k] = os.environ[envname]
|
|
93
|
+
super().__init__(**kwargs)
|
|
94
|
+
|
|
95
|
+
def __repr__(self):
|
|
96
|
+
"""Returns a string representation of the global configuration object."""
|
|
97
|
+
return " ".join(["{}={}".format(k, getattr(self, k)) for k in self.attributes()])
|
|
98
|
+
|
|
99
|
+
#_logger = None
|
|
100
|
+
|
|
101
|
+
from vot.utilities import singleton
|
|
102
|
+
|
|
103
|
+
@singleton
|
|
104
|
+
def get_logger() -> logging.Logger:
|
|
105
|
+
"""Returns the default logger object used to log different messages.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
logging.Logger: Logger handle
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
def init():
|
|
112
|
+
from .utilities import ColoredFormatter
|
|
113
|
+
logger = logging.getLogger("vot")
|
|
114
|
+
stream = logging.StreamHandler()
|
|
115
|
+
stream.setFormatter(ColoredFormatter())
|
|
116
|
+
logger.addHandler(stream)
|
|
117
|
+
if check_debug():
|
|
118
|
+
logger.setLevel(logging.DEBUG)
|
|
119
|
+
return logger
|
|
120
|
+
|
|
121
|
+
return Proxy(init)
|
|
122
|
+
|
|
123
|
+
config = Proxy(lambda: GlobalConfiguration())
|
|
124
|
+
|
|
125
|
+
def check_debug() -> bool:
|
|
126
|
+
"""Checks if debug is enabled for the toolkit via an environment variable.
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
bool: True if debug is enabled, False otherwise
|
|
130
|
+
"""
|
|
131
|
+
return config.debug_mode
|
|
132
|
+
|
|
133
|
+
def print_config():
|
|
134
|
+
"""Prints the global configuration object to the logger."""
|
|
135
|
+
if check_debug():
|
|
136
|
+
get_logger().debug("Configuration: %s", config)
|
vot/__main__.py
ADDED