Skip to content

Commit

Permalink
soft prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Jul 22, 2024
1 parent 96a52c8 commit 4f5e24b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/napatrackmater/Trackvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4022,6 +4022,7 @@ def inception_model_prediction(
total_duration = sub_dataframe["Track Duration"].max()

def sample_subarrays(data, num_samples, tracklet_length, total_duration):

interval = max(1, (total_duration - tracklet_length) // num_samples)
subarrays = []
for i in range(num_samples):
Expand Down Expand Up @@ -4070,9 +4071,7 @@ def get_most_frequent_prediction(predictions):
prediction_counts = Counter(predictions)
most_common_prediction, count = prediction_counts.most_common(1)[0]

total_predictions = len(predictions)
if count > total_predictions // 2:
return most_common_prediction
return most_common_prediction

shape_predictions = []
if shape_model is not None:
Expand Down

0 comments on commit 4f5e24b

Please sign in to comment.