From 9e08f57b277e024337e50248dff6f135899f7771 Mon Sep 17 00:00:00 2001 From: SiddharthDey Date: Wed, 20 Dec 2023 15:13:55 -0800 Subject: [PATCH 1/2] Fix issue #24: branch_added = 0 initialization before the for loop --- openmht/mht.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmht/mht.py b/openmht/mht.py index e99dddd..f938059 100644 --- a/openmht/mht.py +++ b/openmht/mht.py @@ -69,8 +69,8 @@ def __generate_track_trees(self): detections = self.__detections.pop(0) logging.info("Frame {}: {} detections".format(frame_index, len(detections))) track_count = len(kalman_filters) + branches_added = 0 # Total number of branches added to all the track tree at this frame for index, detection in enumerate(detections): - branches_added = 0 # Number of branches added to the track tree at this frame detection_id = str(index) coordinates[frame_index][detection_id] = detection From 68e9b85cf54cda7daafbf68b149ca7743b04fd26 Mon Sep 17 00:00:00 2001 From: SiddharthDey Date: Wed, 24 Jan 2024 15:06:00 -0800 Subject: [PATCH 2/2] pushing to repo --- openmht/__main__.py | 1 - openmht/cli.py | 9 +++++++-- openmht/mht.py | 6 ++++-- openmht/weighted_graph.py | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/openmht/__main__.py b/openmht/__main__.py index 2dcde96..a3b8020 100644 --- a/openmht/__main__.py +++ b/openmht/__main__.py @@ -1,6 +1,5 @@ from openmht import cli - def main(): """Run the OpenMHT command line interface.""" cli.run() diff --git a/openmht/cli.py b/openmht/cli.py index 1253992..ac72079 100644 --- a/openmht/cli.py +++ b/openmht/cli.py @@ -8,7 +8,8 @@ from pathlib import Path -from .mht import MHT +# from .mht import MHT +from mht import MHT logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s', @@ -175,8 +176,12 @@ def run(cli_args=None): if args.plot: # Import here to allow running without matplotlib - from .plot_tracks import plot_2d_tracks + # from .plot_tracks import plot_2d_tracks + from plot_tracks import plot_2d_tracks logging.info("Plotting tracks...") plot_2d_tracks(output_file) logging.info("Done.") + +if __name__ == "__main__": + run() diff --git a/openmht/mht.py b/openmht/mht.py index f938059..be26a60 100644 --- a/openmht/mht.py +++ b/openmht/mht.py @@ -2,8 +2,10 @@ """Multiple Hypothesis Tracking module.""" -from .weighted_graph import WeightedGraph -from .kalman_filter import KalmanFilter +# from .weighted_graph import WeightedGraph +# from .kalman_filter import KalmanFilter +from weighted_graph import WeightedGraph +from kalman_filter import KalmanFilter from copy import deepcopy diff --git a/openmht/weighted_graph.py b/openmht/weighted_graph.py index 97ba7ef..8dec690 100644 --- a/openmht/weighted_graph.py +++ b/openmht/weighted_graph.py @@ -4,7 +4,8 @@ import operator import numpy as np -from .graph import Graph +# from .graph import Graph +from graph import Graph __author__ = "Jon Perdomo" __license__ = "GPL-3.0"