Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #24: branch_added = 0 initialization before the for loop #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion openmht/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from openmht import cli


def main():
"""Run the OpenMHT command line interface."""
cli.run()
Expand Down
9 changes: 7 additions & 2 deletions openmht/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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()
8 changes: 5 additions & 3 deletions openmht/mht.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -69,8 +71,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

Expand Down
3 changes: 2 additions & 1 deletion openmht/weighted_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading