Skip to content

Commit

Permalink
set threshold to 20.0, min_peak_height to 20
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lostanlen committed Oct 3, 2019
1 parent 928096a commit d6589df
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions birdvoxdetect/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def process_file(
output_dir=None,
export_clips=False,
export_confidence=False,
threshold=30.0,
threshold=20.0,
suffix="",
clip_duration=1.0,
logger_level=logging.INFO,
Expand Down Expand Up @@ -142,6 +142,9 @@ def process_file(
chunk_duration = 450
queue_length = 1

# Define minimum peak height for BirdVoxDetect function.
min_peak_height = 10

# Define number of chunks.
sr = sound_file.samplerate
chunk_length = int(chunk_duration * sr)
Expand Down Expand Up @@ -273,7 +276,8 @@ def process_file(
continue

# Find peaks.
peak_locs, _ = scipy.signal.find_peaks(chunk_confidence)
peak_locs, _ = scipy.signal.find_peaks(
chunk_confidence, height=min_peak_height)
peak_vals = chunk_confidence[peak_locs]

# Threshold peaks.
Expand Down Expand Up @@ -406,7 +410,8 @@ def process_file(
continue

# Find peaks.
peak_locs, _ = scipy.signal.find_peaks(chunk_confidence)
peak_locs, _ = scipy.signal.find_peaks(
chunk_confidence, height=min_peak_height)
peak_vals = chunk_confidence[peak_locs]

# Threshold peaks.
Expand Down Expand Up @@ -520,7 +525,8 @@ def process_file(
if threshold is not None:

# Find peaks.
peak_locs, _ = scipy.signal.find_peaks(chunk_confidence)
peak_locs, _ = scipy.signal.find_peaks(
chunk_confidence, height=min_peak_height)
peak_vals = chunk_confidence[peak_locs]

# Threshold peaks.
Expand Down

0 comments on commit d6589df

Please sign in to comment.