Allow image-dir as --input-video

This commit is contained in:
Ruben van de Ven 2023-03-31 15:58:02 +02:00
parent e9fa1e8014
commit abf8085ab7

View file

@ -49,9 +49,14 @@ def track(opt):
n_frame = 0 n_frame = 0
logger.info('Starting tracking...') logger.info('Starting tracking...')
if os.path.isdir(opt.input_video):
print('Use image sequence')
dataloader = datasets.LoadImages(opt.input_video, opt.img_size)
frame_rate = 30 # hack for now; see https://motchallenge.net/data/MOT16/
else:
dataloader = datasets.LoadVideo(opt.input_video, opt.img_size) dataloader = datasets.LoadVideo(opt.input_video, opt.img_size)
result_filename = os.path.join(result_root, 'results.txt')
frame_rate = dataloader.frame_rate frame_rate = dataloader.frame_rate
result_filename = os.path.join(result_root, 'results.txt')
frame_dir = None if opt.output_format=='text' else osp.join(result_root, 'frame') frame_dir = None if opt.output_format=='text' else osp.join(result_root, 'frame')
try: try: