Skip to content

Commit

Permalink
Removed SNR
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Oct 19, 2024
1 parent 1e39acd commit e862ea8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,12 @@ <h6 class="fs-6">Audio Library:<a class="circle new-circle me-2" tabindex="-1" d
Not available in the BirdNET model">?</a>
</div>
</div>
<div class="chirpity-only me-auto">
<!-- <div class="chirpity-only me-auto"> -->
<div class="d-none me-auto">
<div class="form-group rounded p-2 mb-2">
<a class="circle" tabindex="-1" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-title="Signal to Noise Ratio" id="Signal to Noise Ratio-circle-help" data-bs-content="Skip over portions of audio with just background noise. Higher values skip increasingly noisy segments.
Not available in the BirdNET model">?</a>
<a class="circle text-bg-danger" tabindex="-1" data-bs-toggle="popover" data-bs-html="true" data-bs-trigger="focus" data-bs-title="Signal to Noise Ratio" id="Signal to Noise Ratio-circle-help" data-bs-content="The SNR filter, when enabled, will skip over portions of audio where any audio event is below the threshold. Higher values skip increasingly noisy segments.
whilst this will result in faster processing it must be considered <b><i>experimental</i></b> and any non-zero value may miss detections. <b>Tip:</b> To find a workable SNR value, run analysis on a short file with the faintest detections you can confidently identify. Increase the SNR value until the detection is not picked up.
Once you find this threshold, back it off to the highest level that picks up the detection.">?</a>
<label for="snrValue" class="form-label">
SNR filter:
</label>
Expand Down
2 changes: 1 addition & 1 deletion js/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class Model {
if (BACKEND === 'webgl' && TensorBatch.shape[0] < this.batchSize && !this.selection) {
// WebGL backend works best when all batches are the same size
paddedTensorBatch = this.padBatch(TensorBatch) // + 1 tensor
} else if (threshold) {
} else if (threshold && BACKEND === 'tensorflow' && !this.selection) {
if (this.version !== 'v1') threshold *= 4;
const keysTensor = tf.stack(keys); // + 1 tensor
const snr = this.getSNR(TensorBatch)
Expand Down
4 changes: 4 additions & 0 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,10 @@ window.onload = async () => {
};
//fill in defaults - after updates add new items
syncConfig(config, defaultConfig);

// Disable SNR
config.filters.SNR = 0;

// set version
config.VERSION = VERSION;
// switch off debug mode we don't want this to be remembered
Expand Down

0 comments on commit e862ea8

Please sign in to comment.