Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Usernamesername committed Aug 1, 2024
1 parent f0def9e commit 2402696
Show file tree
Hide file tree
Showing 107 changed files with 4,165 additions and 0 deletions.
8 changes: 8 additions & 0 deletions trackeval/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions trackeval/.idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions trackeval/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions trackeval/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions trackeval/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions trackeval/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions trackeval/.idea/trackeval.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

363 changes: 363 additions & 0 deletions trackeval/Readme.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions trackeval/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .eval import Evaluator
from . import datasets
from . import metrics
from . import plotting
from . import utils
Binary file added trackeval/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/_timing.cpython-311.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/_timing.cpython-37.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/_timing.cpython-38.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/_timing.cpython-39.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/eval.cpython-311.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/eval.cpython-37.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/eval.cpython-38.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/eval.cpython-39.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/plotting.cpython-311.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/plotting.cpython-37.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/plotting.cpython-38.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/plotting.cpython-39.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/utils.cpython-311.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/utils.cpython-37.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/utils.cpython-38.pyc
Binary file not shown.
Binary file added trackeval/__pycache__/utils.cpython-39.pyc
Binary file not shown.
65 changes: 65 additions & 0 deletions trackeval/_timing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from functools import wraps
from time import perf_counter
import inspect

DO_TIMING = False
DISPLAY_LESS_PROGRESS = False
timer_dict = {}
counter = 0


def time(f):
@wraps(f)
def wrap(*args, **kw):
if DO_TIMING:
# Run function with timing
ts = perf_counter()
result = f(*args, **kw)
te = perf_counter()
tt = te-ts

# Get function name
arg_names = inspect.getfullargspec(f)[0]
if arg_names[0] == 'self' and DISPLAY_LESS_PROGRESS:
return result
elif arg_names[0] == 'self':
method_name = type(args[0]).__name__ + '.' + f.__name__
else:
method_name = f.__name__

# Record accumulative time in each function for analysis
if method_name in timer_dict.keys():
timer_dict[method_name] += tt
else:
timer_dict[method_name] = tt

# If code is finished, display timing summary
if method_name == "Evaluator.evaluate":
print("")
print("Timing analysis:")
for key, value in timer_dict.items():
print('%-70s %2.4f sec' % (key, value))
else:
# Get function argument values for printing special arguments of interest
arg_titles = ['tracker', 'seq', 'cls']
arg_vals = []
for i, a in enumerate(arg_names):
if a in arg_titles:
arg_vals.append(args[i])
arg_text = '(' + ', '.join(arg_vals) + ')'

# Display methods and functions with different indentation.
if arg_names[0] == 'self':
print('%-74s %2.4f sec' % (' '*4 + method_name + arg_text, tt))
elif arg_names[0] == 'test':
pass
else:
global counter
counter += 1
print('%i %-70s %2.4f sec' % (counter, method_name + arg_text, tt))

return result
else:
# If config["TIME_PROGRESS"] is false, or config["USE_PARALLEL"] is true, run functions normally without timing.
return f(*args, **kw)
return wrap
18 changes: 18 additions & 0 deletions trackeval/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# from .kitti_2d_box import Kitti2DBox
# from .kitti_mots import KittiMOTS
# from .mots_challenge import MOTSChallenge
# from .bdd100k import BDD100K
# from .davis import DAVIS
# from .tao import TAO
# from .tao_ow import TAO_OW
# try:
# from .burst import BURST
# from .burst_ow import BURST_OW
# except ImportError as err:
# print(f"Error importing BURST due to missing underlying dependency: {err}")
# from .youtube_vis import YouTubeVIS
# from .head_tracking_challenge import HeadTrackingChallenge
# from .rob_mots import RobMOTS
# from .person_path_22 import PersonPath22

# from .mot_challenge_2d_box import MotChallenge2DBox
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 2402696

Please sign in to comment.