Skip to content

Commit

Permalink
adjust threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Mar 9, 2023
1 parent 0e9da0a commit 6be994e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Melt/identify_bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
logging.basicConfig(
stream=sys.stderr, level=logging.INFO, format=fmt, datefmt="%Y-%m-%d %H:%M:%S"
)
PROB_THRESH = 0.8


def load_recording(file, resample=48000):
Expand Down Expand Up @@ -125,7 +126,7 @@ def classify(file, model_file):
track_labels = []
if multi_label:
for i, p in enumerate(prediction):
if p >= 0.7:
if p >= PROB_THRESH:
label = labels[i]
results.append((p, label))
track_labels.append(label)
Expand All @@ -138,7 +139,7 @@ def classify(file, model_file):
else:
best_i = np.argmax(prediction)
best_p = prediction[best_i]
if best_p >= 0.7:
if best_p >= PROB_THRESH:
label = labels[best_i]
results.append((best_p, label))
track_labels.append(label)
Expand Down

0 comments on commit 6be994e

Please sign in to comment.