From 40bf868008235443aa23192a27a5b565caa36369 Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Sun, 26 Nov 2023 11:54:37 +0000 Subject: [PATCH] Updates to help section Fixed bug with confidence display Bumped version --- Help/keyboard.html | 10 ++++----- Help/settings.html | 14 ++++++++++-- Help/usage.html | 56 ++++++++++++++++++++++++---------------------- js/ui.js | 42 +++++++++++++++++----------------- js/worker.js | 7 +----- package.json | 2 +- 6 files changed, 70 insertions(+), 61 deletions(-) diff --git a/Help/keyboard.html b/Help/keyboard.html index 97c84e9b..f9c11b0f 100644 --- a/Help/keyboard.html +++ b/Help/keyboard.html @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -122,7 +122,7 @@ - + diff --git a/Help/settings.html b/Help/settings.html index a6d3b731..b9c61af8 100644 --- a/Help/settings.html +++ b/Help/settings.html @@ -131,6 +131,18 @@ + + +
File handling
File handling
Ctrl-O
Analysis
Analysis
Ctrl-AStop analysis
Transport Controls
Transport Controls
SpaceBarSkip back to the previous detection
Spectrogram
Spectrogram
Ctrl+ or + Toggle Fullscreen mode
Records
Records
Delete or Backspace
ModelChoose the model to use for prediction. +
    +
  • + Chirpity will use the native Chirpity model for predictions. +
  • +
  • + BirdNet will use the BirdNet model. +
  • +
+
Threads This setting allows you to select the number of threads to use for predictions. @@ -142,8 +154,6 @@ Batch Size This setting determines the number of three-second audio chunks to process each time a prediction is requested. Larger values lead to faster processing, especially on long files. - However, setting it too high for your machine can cause the Chirpity model to crash due to memory limitations. - If this happens, set a lower value and restart Chirpity.
diff --git a/Help/usage.html b/Help/usage.html index 8601ad52..8a596114 100644 --- a/Help/usage.html +++ b/Help/usage.html @@ -107,7 +107,7 @@
Exploring Detections
Summary and Filtering Detections
-
    +
    1. A summary table appears to the left of the results once the model has completed its analysis. Importantly, this @@ -118,7 +118,7 @@
      Summary and Filtering Detections
    Custom "Deep Dive" Detections
    -
      +
      1. Sometimes, a call is missed or a detection is erroneous due to the position of the analysis window in relation to the call. The window can be moved by dragging it, or you can create a new window by clicking and @@ -132,7 +132,7 @@
        Custom "Deep Dive" Detections
      Amending Results
      -
        +
        1. It is possible to remove results from what will be saved by selecting delete_forever Delete Record in the context menu. This can be selected on a per-detection basis in the results table, or a per-species basis in the summary. @@ -141,32 +141,10 @@
          Amending Results
        Saving Results
        -
          -
        1. There are several ways to save results: -
            - +
            1. Once the analysis is complete, and after you have made any amendments, you can save the results to a - database Records > Save to Archive - After this, it will bring in the results from the database records. You can also explore and chart - saved records. - -
            2. Save the detections as a label file in Audacity format. Press Ctrl-A or select File > Save - Audacity Labels from the menu. By default, the label file will have the same name as the - audio file, - with a ".txt" extension. + database by selecting Records > archive Save to Archive
            3. -
            4. - Export an audio clip of a detection. To do this, select - music_note - Export Audio Clip on the context menu. By default, the filename will contain the - species and - timestamp of the detection identifying its position in the original audio file. The Settings - menu allows you - to control the format and quality of the exported files as well as apply padding and a fade effect - to the beginning and end of the audio. -
            5. -
            -
          Restoring Results
          @@ -181,6 +159,30 @@
          Restoring Results
          cue from this file's creation time, use the original one.

          From the records menu, you can also browse saved detections by species, and within a date range of your choosing. Furthermore, you can generate charts of the species detected over time.

          + +
          Exporting Results
          + There are a number of ways to export detections. +
            +
          1. Save the detections as a label file in Audacity format. Press Ctrl-A or select File > Save + Audacity Labels from the menu. By default, the label file will have the same name as the + audio file,with a ".txt" extension. +
          2. +
          3. + Export an audio clip of a detection. To do this, select + music_note + Export Audio Clip on the context menu. By default, the filename will contain the + species and + timestamp of the detection identifying its position in the original audio file. The Settings + menu allows you + to control the format and quality of the exported files as well as apply padding and a fade effect + to the beginning and end of the audio. +
          4. +
          5. + Export a CSV file of detections. To do this, select + ios_share + Export results to CSV from the file menu. This will export the results to a CSV file in the folder you choose. +
          6. +
          \ No newline at end of file diff --git a/js/ui.js b/js/ui.js index bcc3b343..77b2a430 100644 --- a/js/ui.js +++ b/js/ui.js @@ -3451,43 +3451,42 @@ document.addEventListener("DOMContentLoaded", function () { // Confidence thresholds -const thresholdDisplay = document.getElementById('threshold-value'); -const confidenceDisplay = document.getElementById('confidence-value'); -const confidenceSliderDisplay = document.getElementById('confidenceSliderContainer'); -const confidenceSlider = document.getElementById('confidenceValue'); -const confidenceRange = document.getElementById('confidence'); - +const filterPanelThresholdDisplay = document.getElementById('threshold-value'); // confidence % display in panel +const settingsPanelThresholdDisplay = document.getElementById('confidence-value'); // confidence % display in settings +const confidenceSliderDisplay = document.getElementById('confidenceSliderContainer'); // confidence span for slider in panel - show-hide +const filterPanelRangeInput = document.getElementById('confidenceValue'); // panel range input +const settingsPanelRangeInput = document.getElementById('confidence'); // confidence range input in settings const setConfidence = (e) => { - - confidenceRange.value = e.target.value; + //settingsPanelRangeInput.value = e.target.value; handleThresholdChange(e); } -thresholdDisplay.addEventListener('click', (e) => { +filterPanelThresholdDisplay.addEventListener('click', (e) => { e.stopPropagation(); confidenceSliderDisplay.classList.toggle('d-none'); - // confidenceTimerTimeout = setTimeout(hideConfidenceSlider, 1750) }) -confidenceSlider.addEventListener('click', (e) => { +filterPanelRangeInput.addEventListener('click', (e) => { e.stopPropagation(); }) + const hideConfidenceSlider = () => { confidenceSliderDisplay.classList.add('d-none'); } -confidenceSliderDisplay.addEventListener('change', setConfidence); -function showThreshold(threshold) { - thresholdDisplay.innerHTML = `${threshold}%`; - confidenceDisplay.innerHTML = `${threshold}%`; - confidenceSlider.value = threshold; - confidenceRange.value = threshold; +function showThreshold(e) { + const threshold = e instanceof Event ? parseInt(e.target.value) : e; + filterPanelThresholdDisplay.innerHTML = `${threshold}%`; + settingsPanelThresholdDisplay.innerHTML = `${threshold}%`; + filterPanelRangeInput.value = threshold; + settingsPanelRangeInput.value = threshold; } +settingsPanelRangeInput.addEventListener('input', showThreshold); +filterPanelRangeInput.addEventListener('input', showThreshold); const handleThresholdChange = (e) => { const threshold = parseInt(e.target.value); - showThreshold(threshold); config.detect.confidence = threshold; updatePrefs(); worker.postMessage({ @@ -3505,10 +3504,13 @@ const handleThresholdChange = (e) => { action: 'filter', species: isSpeciesViewFiltered(true), updateSummary: true - }); // no re-prepare + }); } } -confidenceRange.addEventListener('input', handleThresholdChange); +filterPanelRangeInput.addEventListener('change', handleThresholdChange); +settingsPanelRangeInput.addEventListener('change', handleThresholdChange); + + // Filter handling const filterIconDisplay = () => { if (config.filters.active && (config.filters.highPassFrequency || (config.filters.lowShelfAttenuation && config.filters.lowShelfFrequency) || config.filters.SNR)) { diff --git a/js/worker.js b/js/worker.js index a074b298..4788669c 100644 --- a/js/worker.js +++ b/js/worker.js @@ -2060,8 +2060,6 @@ async function setStartEnd(file) { } else { boundaries = [{ start: 0, end: meta.duration }]; } - // const { start, end } = boundaries[0]; - // return [start, end]; return boundaries; } @@ -2083,7 +2081,6 @@ const getSummary = async ({ } t0 = Date.now(); - //const speciesForSTMT = species || '%'; const params = getSummaryParams(species); const summary = await STATE.GET_SUMMARY_SQL.allAsync(...params); @@ -2105,7 +2102,6 @@ const getSummary = async ({ * * @param files: files to query for detections * @param species: filter for SQL query - * @param context: can be 'results', 'resultSummary' or 'selectionResults' * @param limit: the pagination limit per page * @param offset: is the SQL query offset to use * @param topRankin: return results >= to this rank for each datetime @@ -2115,7 +2111,6 @@ const getSummary = async ({ */ const getResults = async ({ species = undefined, - context = 'results', limit = STATE.limit, offset = undefined, topRankin = STATE.topRankin, @@ -2168,7 +2163,7 @@ const getResults = async ({ i === result.length - 1 && UI.postMessage({ event: 'generate-alert', message: `${result.length} files saved` }) } } - else if (species && context !== 'explore') { + else if (species && STATE.mode !== 'explore') { // get a number for the circle const { count } = await STATE.db.getAsync(`SELECT COUNT(*) as count FROM records WHERE dateTime = ? AND confidence >= ?`, r.timestamp, confidence); diff --git a/package.json b/package.json index a7e4db94..bb42909c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chirpity", - "version": "0.10.1", + "version": "0.10.2", "description": "Chirpity Nocmig", "main": "main.js", "scripts": {