Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Aug 2, 2024
1 parent 7d293c9 commit 9989fe9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/nn/test_tracker_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def run_tracker_by_name(frames=None, img_scale: float = 0, **kwargs):
# Create tracker
t = Tracker.make_tracker_by_name(verbosity='none', **kwargs)
t = Tracker.make_tracker_by_name(verbosity="none", **kwargs)
# Update img_scale
if img_scale:
if hasattr(t, "candidate_maker") and hasattr(t.candidate_maker, "img_scale"):
Expand Down
12 changes: 7 additions & 5 deletions tests/nn/test_tracking_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ def test_simplemax_tracker(tmpdir, centered_pair_predictions_slp_path):
# TODO: Refactor the below things into a real test suite.
# running an equivalent to `make_ground_truth` is done as a test in tests/nn/test_tracker_components.py


def make_ground_truth(frames, tracker, gt_filename):
t0 = time.time()
new_labels = tracker.run_tracker(frames, verbosity='none')
new_labels = tracker.run_tracker(frames, verbosity="none")
print(f"{gt_filename}\t{len(tracker.spawned_tracks)}\t{time.time()-t0}")
Labels.save_file(new_labels, gt_filename)


def compare_ground_truth(frames, tracker, gt_filename):
t0 = time.time()
new_labels = tracker.run_tracker(frames, verbosity='none')
new_labels = tracker.run_tracker(frames, verbosity="none")
print(f"{gt_filename}\t{time.time() - t0}")

does_match = check_tracks(new_labels, gt_filename)
Expand Down Expand Up @@ -78,7 +79,6 @@ def check_tracks(labels, gt_filename, limit=None):
return True



def main(f, dir):
filename = "tests/data/json_format_v2/centered_pair_predictions.json"

Expand Down Expand Up @@ -128,7 +128,10 @@ def make_tracker(
return tracker

def make_filename(tracker_name, matcher_name, sim_name, scale=0):
return os.path.join(dir, f"{tracker_name}_{int(scale * 100)}_{matcher_name}_{sim_name}.h5")
return os.path.join(
dir,
f"{tracker_name}_{int(scale * 100)}_{matcher_name}_{sim_name}.h5",
)

def make_tracker_and_filename(*args, **kwargs):
tracker = make_tracker(*args, **kwargs)
Expand All @@ -142,7 +145,6 @@ def make_tracker_and_filename(*args, **kwargs):
for tracker_name in trackers.keys():
for matcher_name in matchers.keys():
for sim_name in similarities.keys():

if tracker_name == "flow":
# If this tracker supports scale, try multiple scales
for scale in scales:
Expand Down

0 comments on commit 9989fe9

Please sign in to comment.