Closed amunamun07 closed 2 years ago
Run "python main.py --video [video_path]"
import argparse
from centroid.single_object_tracking import SingleObjectTracking
from centroid.multiple_object_tracking import MultipleObjectTracking
def main(args):
args = parse_args(args)
if args.mode.lower() == "single":
parser = SingleObjectTracking(args.tracker, args.video)
parser.start_tracking()
if args.mode.lower() == "multiple":
parser = MultipleObjectTracking(args.tracker, args.video)
parser.start_tracking()
def parse_args(args):
parser = argparse.ArgumentParser(description='For Object Tracking')
parser.add_argument('--mode', help='Single or Multiple', default="multiple")
parser.add_argument('--tracker', help='The Tracking Algorithm', default="boosting")
parser.add_argument('--video', help='Path to the Video', required=True)
return parser.parse_args(args)
if __name__ == '__main__':
import sys
main(sys.argv[1:])
tracker = self.get_tracker()
- it's an object of cv::legacy::Tracker
on C++ side. It's capable to track single object only. You feed all bounding boxes for different objects to single instance. It breaks tracker behavior. You need to create separate Tracker instance for each tracked object.
System information (version)
Detailed description
I think there is a problem in the multitrack.update(frame) section. All the bounding boxes i set initially only track one object and the other objects are ignored. Please help.
Steps to reproduce