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.
Files changed (102) hide show
  1. vot/__init__.py +136 -0
  2. vot/__main__.py +8 -0
  3. vot/analysis/__init__.py +574 -0
  4. vot/analysis/accuracy.py +418 -0
  5. vot/analysis/failures.py +98 -0
  6. vot/analysis/longterm.py +728 -0
  7. vot/analysis/multistart.py +441 -0
  8. vot/analysis/processor.py +915 -0
  9. vot/analysis/supervised.py +324 -0
  10. vot/analysis/tests.py +22 -0
  11. vot/dataset/__init__.py +1272 -0
  12. vot/dataset/common.py +351 -0
  13. vot/dataset/cow.png +0 -0
  14. vot/dataset/dummy.py +97 -0
  15. vot/dataset/got10k.py +128 -0
  16. vot/dataset/otb.py +230 -0
  17. vot/dataset/proxy.py +433 -0
  18. vot/dataset/trackingnet.py +122 -0
  19. vot/experiment/__init__.py +377 -0
  20. vot/experiment/helpers.py +53 -0
  21. vot/experiment/multirun.py +267 -0
  22. vot/experiment/multistart.py +126 -0
  23. vot/experiment/transformer.py +144 -0
  24. vot/region/__init__.py +146 -0
  25. vot/region/io.py +313 -0
  26. vot/region/raster.py +416 -0
  27. vot/region/shapes.py +507 -0
  28. vot/region/tests.py +104 -0
  29. vot/report/__init__.py +736 -0
  30. vot/report/commands.tex +16 -0
  31. vot/report/common.py +259 -0
  32. vot/report/html.py +199 -0
  33. vot/report/jquery.js +2 -0
  34. vot/report/latex.py +162 -0
  35. vot/report/pure.css +11 -0
  36. vot/report/report.css +153 -0
  37. vot/report/report.js +50 -0
  38. vot/report/table.js +280 -0
  39. vot/report/tests.py +0 -0
  40. vot/report/video.py +127 -0
  41. vot/stack/__init__.py +123 -0
  42. vot/stack/otb100.yaml +10 -0
  43. vot/stack/otb50.yaml +10 -0
  44. vot/stack/tests/basic.yaml +7 -0
  45. vot/stack/tests/multiobject.yaml +21 -0
  46. vot/stack/tests/segmentation.yaml +28 -0
  47. vot/stack/tests.py +33 -0
  48. vot/stack/vot2013.yaml +14 -0
  49. vot/stack/vot2014.yaml +14 -0
  50. vot/stack/vot2015/rgb.yaml +15 -0
  51. vot/stack/vot2015/tir.yaml +11 -0
  52. vot/stack/vot2016/rgb.yaml +21 -0
  53. vot/stack/vot2016/tir.yaml +11 -0
  54. vot/stack/vot2017.yaml +35 -0
  55. vot/stack/vot2018/longterm.yaml +20 -0
  56. vot/stack/vot2018/shortterm.yaml +33 -0
  57. vot/stack/vot2019/longterm.yaml +20 -0
  58. vot/stack/vot2019/rgbd.yaml +11 -0
  59. vot/stack/vot2019/rgbtir.yaml +15 -0
  60. vot/stack/vot2019/shortterm.yaml +33 -0
  61. vot/stack/vot2020/longterm.yaml +20 -0
  62. vot/stack/vot2020/rgbd.yaml +11 -0
  63. vot/stack/vot2020/rgbtir.yaml +15 -0
  64. vot/stack/vot2020/shortterm.yaml +37 -0
  65. vot/stack/vot2021/longterm.yaml +20 -0
  66. vot/stack/vot2021/rgbd.yaml +11 -0
  67. vot/stack/vot2021/shortterm.yaml +37 -0
  68. vot/stack/vot2022/depth.yaml +16 -0
  69. vot/stack/vot2022/longterm.yaml +20 -0
  70. vot/stack/vot2022/rgbd.yaml +16 -0
  71. vot/stack/vot2022/shortterm.yaml +37 -0
  72. vot/stack/vot2022/shorttermbox.yaml +37 -0
  73. vot/stack/vots2023.yaml +7 -0
  74. vot/stack/vots2024/main.yaml +7 -0
  75. vot/stack/vots2024/votst.yaml +7 -0
  76. vot/stack/vots2024/votstval.yaml +25 -0
  77. vot/stack/vots2025/main.yaml +7 -0
  78. vot/stack/vots2025/realtime.yaml +13 -0
  79. vot/stack/vots2025/votst.yaml +7 -0
  80. vot/tracker/__init__.py +924 -0
  81. vot/tracker/dummy.py +29 -0
  82. vot/tracker/results.py +305 -0
  83. vot/tracker/tests.py +20 -0
  84. vot/tracker/trax.py +809 -0
  85. vot/utilities/__init__.py +675 -0
  86. vot/utilities/cli.py +549 -0
  87. vot/utilities/data.py +198 -0
  88. vot/utilities/draw.py +283 -0
  89. vot/utilities/io.py +48 -0
  90. vot/utilities/migration.py +110 -0
  91. vot/utilities/net.py +239 -0
  92. vot/utilities/notebook.py +375 -0
  93. vot/version.py +4 -0
  94. vot/workspace/__init__.py +257 -0
  95. vot/workspace/storage.py +478 -0
  96. vot/workspace/tests.py +70 -0
  97. vot_toolkit-0.7.2.dist-info/LICENSE +674 -0
  98. vot_toolkit-0.7.2.dist-info/METADATA +82 -0
  99. vot_toolkit-0.7.2.dist-info/RECORD +102 -0
  100. vot_toolkit-0.7.2.dist-info/WHEEL +5 -0
  101. vot_toolkit-0.7.2.dist-info/entry_points.txt +46 -0
  102. 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
@@ -0,0 +1,8 @@
1
+ """ This module is a shortcut for the CLI interface so that it can be run as a "vot" module. """
2
+
3
+ # Just a shortcut for the CLI interface so that it can be run as a "vot" module.
4
+
5
+ from vot.utilities.cli import main
6
+
7
+ if __name__ == '__main__':
8
+ main()