diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/demo.py b/demo.py index 3041970..0dabab0 100755 --- a/demo.py +++ b/demo.py @@ -9,9 +9,9 @@ import argparse -from iou_tracker import track_iou -from viou_tracker import track_viou -from util import load_mot, save_to_csv +from iou_tracker.iou_tracker import track_iou +from iou_tracker.viou_tracker import track_viou +from iou_tracker.util import load_mot, save_to_csv def main(args): diff --git a/iou_tracker/__init__.py b/iou_tracker/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iou_tracker.py b/iou_tracker/iou_tracker.py similarity index 98% rename from iou_tracker.py rename to iou_tracker/iou_tracker.py index 12cd6bb..dcb1cea 100644 --- a/iou_tracker.py +++ b/iou_tracker/iou_tracker.py @@ -7,7 +7,7 @@ from time import time -from util import load_mot, iou +from .util import load_mot, iou def track_iou(detections, sigma_l, sigma_h, sigma_iou, t_min): @@ -30,7 +30,7 @@ def track_iou(detections, sigma_l, sigma_h, sigma_iou, t_min): tracks_active = [] tracks_finished = [] - for frame_num, detections_frame in enumerate(detections, start=1): + for frame_num, detections_frame in enumerate(detections, start=0): # apply low threshold to detections dets = [det for det in detections_frame if det['score'] >= sigma_l] diff --git a/util.py b/iou_tracker/util.py similarity index 99% rename from util.py rename to iou_tracker/util.py index c6717b4..d6282d7 100644 --- a/util.py +++ b/iou_tracker/util.py @@ -194,7 +194,7 @@ def save_to_csv(out_path, tracks, fmt='motchallenge'): 'y': bbox[1]+1, 'w': bbox[2] - bbox[0], 'h': bbox[3] - bbox[1], - 'score': track['max_score']} + 'score': track['max_score'].item()} if fmt == 'motchallenge': row['wx'] = -1 row['wy'] = -1 diff --git a/viou_tracker.py b/iou_tracker/viou_tracker.py similarity index 99% rename from viou_tracker.py rename to iou_tracker/viou_tracker.py index 020a30e..81efad4 100644 --- a/viou_tracker.py +++ b/iou_tracker/viou_tracker.py @@ -11,8 +11,8 @@ from tqdm import tqdm from time import time -from util import iou, load_mot -from vis_tracker import VisTracker +from .util import iou, load_mot +from .vis_tracker import VisTracker def track_viou(frames_path, detections, sigma_l, sigma_h, sigma_iou, t_min, ttl, tracker_type, keep_upper_height_ratio): @@ -45,7 +45,7 @@ def track_viou(frames_path, detections, sigma_l, sigma_h, sigma_iou, t_min, ttl, tracks_finished = [] frame_buffer = [] - for frame_num, detections_frame in enumerate(tqdm(detections), start=1): + for frame_num, detections_frame in enumerate(tqdm(detections), start=0): # load frame and put into buffer frame_path = frames_path.format(frame_num) frame = cv2.imread(frame_path) diff --git a/vis_tracker.py b/iou_tracker/vis_tracker.py similarity index 100% rename from vis_tracker.py rename to iou_tracker/vis_tracker.py diff --git a/mot16.py b/mot16.py index b7bf173..25c02a2 100755 --- a/mot16.py +++ b/mot16.py @@ -10,8 +10,8 @@ from time import time import argparse -from iou_tracker import track_iou -from util import load_mot, save_to_csv +from iou_tracker.iou_tracker import track_iou +from iou_tracker.util import load_mot, save_to_csv def main(args): diff --git a/mot17.py b/mot17.py index 1da6b8d..f018e28 100755 --- a/mot17.py +++ b/mot17.py @@ -10,8 +10,8 @@ from time import time import argparse -from iou_tracker import track_iou -from util import load_mot, save_to_csv +from iou_tracker.iou_tracker import track_iou +from iou_tracker.util import load_mot, save_to_csv def main(args): diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..576328d --- /dev/null +++ b/setup.py @@ -0,0 +1,10 @@ +from setuptools import find_packages, setup + +setup( + name='iou_tracker', + packages=find_packages(), + version='0.1', + description='IOU Tracker', + author='Erik Bochinski and Volker Eiselein and Thomas Sikora', + license='MIT License', +)