Skip to content

Commit

Permalink
fix short tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed May 28, 2023
1 parent 6ad41ec commit f233ab2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Melt/identify_bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ def classify(file, model_file):
track.label == "bird" and specific_bird
):
track.end = min(length, track.end - segment_stride)

del active_tracks[track.label]
if start >= track.end:
# with smaller strides may have overlaps
del active_tracks[track.label]

for r in results:
label = r[1]
Expand All @@ -246,7 +247,9 @@ def classify(file, model_file):
tracks.append(track)
active_tracks[label] = track
else:
track.end = start - segment_stride
track.end = start + segment_length
if track.end > length:
track.end = length
track.confidences.append(r[0])
# else:

Expand Down

0 comments on commit f233ab2

Please sign in to comment.