Spaces:
Sleeping
Sleeping
File size: 1,191 Bytes
d4b77ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# --------------------------------------------------------
# Python Single Object Tracking Evaluation
# Licensed under The MIT License [see LICENSE for details]
# Written by Fangyi Zhang
# @author [email protected]
# @project https://github.com/StrangerZhang/pysot-toolkit.git
# Revised for SiamMask by foolwood
# --------------------------------------------------------
class Dataset(object):
def __init__(self, name, dataset_root):
self.name = name
self.dataset_root = dataset_root
self.videos = None
def __getitem__(self, idx):
if isinstance(idx, str):
return self.videos[idx]
elif isinstance(idx, int):
return self.videos[sorted(list(self.videos.keys()))[idx]]
def __len__(self):
return len(self.videos)
def __iter__(self):
keys = sorted(list(self.videos.keys()))
for key in keys:
yield self.videos[key]
def set_tracker(self, path, tracker_names):
"""
Args:
path: path to tracker results,
tracker_names: list of tracker name
"""
self.tracker_path = path
self.tracker_names = tracker_names
|