Saved Records
You can save records for future reference from the Records menu. Here you will
@@ -272,7 +279,7 @@
Saved Records
Threshold:
?
diff --git a/js/BirdNet2.4.js b/js/BirdNet2.4.js
index 744fb2c4..56d5b6a2 100644
--- a/js/BirdNet2.4.js
+++ b/js/BirdNet2.4.js
@@ -7,7 +7,10 @@ let BACKEND;
//GLOBALS
let myModel;
// const MIGRANTS = new Set(["Pluvialis dominica_American Golden Plover", "Acanthis hornemanni_Arctic Redpoll", "Sterna paradisaea_Arctic Tern", "Recurvirostra avosetta_Avocet", "Porzana pusilla_Baillon's Crake", "Limosa lapponica_Bar-tailed Godwit", "Tyto alba_Barn Owl", "Branta leucopsis_Barnacle Goose", "Cygnus columbianus_Bewick's Swan", "Botaurus stellaris_Bittern", "Chroicocephalus ridibundus_Black-headed Gull", "Podiceps nigricollis_Black-necked Grebe", "Limosa limosa_Black-tailed Godwit", "Turdus merula_Blackbird", "Sylvia atricapilla_Blackcap", "Fringilla montifringilla_Brambling", "Branta bernicla_Brent Goose", "Branta canadensis_Canada Goose", "Larus cachinnans_Caspian Gull", "Phylloscopus collybita_Chiffchaff", "Loxia curvirostra_Common Crossbill", "Larus canus_Common Gull", "Acanthis flammea_Common Redpoll", "Actitis hypoleucos_Common Sandpiper", "Melanitta nigra_Common Scoter", "Sterna hirundo_Common Tern", "Fulica atra_Coot", "Crex crex_Corncrake", "Cuculus canorus_Cuckoo", "Calidris ferruginea_Curlew Sandpiper", "Numenius arquata_Curlew", "Charadrius morinellus_Dotterel", "Calidris alpina_Dunlin", "Prunella modularis_Dunnock", "Alopochen aegyptiaca_Egyptian Goose", "Turdus pilaris_Fieldfare", "Mareca strepera_Gadwall", "Sylvia borin_Garden Warbler", "Spatula querquedula_Garganey", "Regulus regulus_Goldcrest", "Pluvialis apricaria_Golden Plover", "Bucephala clangula_Goldeneye", "Mergus merganser_Goosander", "Locustella naevia_Grasshopper Warbler", "Larus marinus_Great Black-backed Gull", "Podiceps cristatus_Great Crested Grebe", "Tringa ochropus_Green Sandpiper", "Tringa nebularia_Greenshank", "Ardea cinerea_Grey Heron", "Perdix perdix_Grey Partridge", "Phalaropus fulicarius_Grey", "Pluvialis squatarola_Grey Plover", "Motacilla cinerea_Grey Wagtail ", "Anser anser_Greylag Goose", "Delichon urbicum_House Martin", "Coccothraustes coccothraustes_Hawfinch", "Larus argentatus_Herring Gull", "Lymnocryptes minimus_Jack Snipe", "Alcedo atthis_Kingfisher", "Calidris canutus_Knot", "Calcarius lapponicus_Lapland Bunting", "Larus fuscus_Lesser Black-backed Gull", "Acanthis cabaret_Lesser Redpoll ", "Sylvia curruca_Lesser Whitethroat", "Linaria cannabina_Linnet", "Egretta garzetta_Little Egret", "Tachybaptus ruficollis_Little Grebe", "Hydrocoloeus minutus_Little Gull", "Athene noctua_Little Owl", "Charadrius dubius_Little Ringed Plover", "Calidris minuta_Little Stint ", "Sternula albifrons_Little Tern", "Asio otus_Long-eared Owl", "Clangula hyemalis_Long-tailed Duck", "Anas platyrhynchos_Mallard", "Aix galericulata_Mandarin Duck", "Anthus pratensis_Meadow Pipit", "Ichthyaetus melanocephalus_Mediterranean Gull", "Turdus viscivorus_Mistle Thrush", "Gallinula chloropus_Moorhen", "Nycticorax nycticorax_Night Heron", "Luscinia megarhynchos_Nightingale", "Luscinia megarhynchos_Nightingale (song)", "Caprimulgus europaeus_Nightjar", "Anthus hodgsoni_Olive-backed Pipit", "Emberiza hortulana_Ortolan Bunting", "Emberiza pusilla_Little Bunting", "Haematopus ostralegus_Oystercatcher", "Ficedula hypoleuca_Pied Flycatcher", "Motacilla alba_Pied Wagtail", "Anser brachyrhynchus_Pink-footed Goose", "Anas acuta_Pintail", "Aythya ferina_Pochard", "Calidris maritima_Purple Sandpiper", "Coturnix coturnix_Quail", "Mergus serrator_Red-breasted Merganser", "Netta rufina_Red-crested Pochard", "Alectoris rufa_Red-legged Partridge", "Tringa totanus_Redshank", "Phoenicurus phoenicurus_Redstart", "Turdus iliacus_Redwing", "Emberiza schoeniclus_Reed Bunting", "Acrocephalus scirpaceus_Reed Warbler", "Turdus torquatus_Ring Ouzel", "Charadrius hiaticula_Ringed Plover", "Erithacus rubecula_Robin (flight call)", "Anthus petrosus_Rock Pipit", "Sterna dougallii_Roseate Tern", "Calidris pugnax_Ruff", "Riparia riparia_Sand Martin", "Calidris alba_Sanderling", "Thalasseus sandvicensis_Sandwich Tern", "Aythya marila_Scaup", "Loxia scotica_Scottish Crossbill", "Acrocephalus schoenobaenus_Sedge Warbler", "Tadorna tadorna_Shelduck", "Asio flammeus_Short-eared Owl", "Spatula clypeata_Shoveler", "Spinus spinus_Siskin", "Alauda arvensis_Skylark", "Gallinago gallinago_Snipe", "Plectrophenax nivalis_Snow Bunting", "Turdus philomelos_Song Thrush", "Porzana porzana_Spotted Crake", "Muscicapa striata_Spotted Flycatcher", "Tringa erythropus_Spotted Redshank", "Burhinus oedicnemus_Stone-curlew", "Saxicola rubicola_Stonechat", "Hirundo rustica_Swallow", "Apus apus_Swift", "Anser fabalis_Taiga Bean Goose", "Strix aluco_Tawny Owl", "Anas crecca_Teal", "Anthus trivialis_Tree Pipit", "Aythya fuligula_Tufted Duck", "Anser serrirostris_Tundra Bean Goose", "Arenaria interpres_Turnstone", "Anthus spinoletta_Water Pipit", "Rallus aquaticus_Water Rail", "Numenius phaeopus_Whimbrel", "Anser albifrons_White-fronted Goose", "Sylvia communis_Whitethroat", "Cygnus cygnus_Whooper Swan", "Mareca penelope_Wigeon", "Phylloscopus trochilus_Willow Warbler", "Tringa glareola_Wood Sandpiper", "Scolopax rusticola_Woodcock", "Lullula arborea_Woodlark", "Larus michahellis_Yellow-legged Gull", "Motacilla flava_Yellow Wagtail", "Emberiza citrinella_Yellowhammer"]);
-// const NOT_BIRDS = ['Ambient Noise_Ambient Noise', 'Animal_Animal', 'Cat_Cat', 'Church Bells_Church Bells', 'Cough_Cough', 'Dog_Dog', 'Human_Human', 'Laugh_Laugh', 'Rain_Rain', 'Red Fox_Red Fox', 'Sneeze_Sneeze', 'Snoring_Snoring', 'Thunder_Thunder', 'Vehicle_Vehicle', 'Water Drops_Water Drops', 'Waves_Waves', 'Wind_Wind'];
+const NOT_BIRDS = ['Dog_Dog', 'Environmental_Environmental', 'Engine_Engine', 'Fireworks_Fireworks',
+'Gryllus assimilis_Gryllus assimilis', 'Gun_Gun', 'Human non-vocal_Human non-vocal', 'Human vocal_Human vocal',
+'Human whistle_Human whistle', 'Miogryllus saussurei_Miogryllus saussurei', 'Noise_Noise',
+'Power tools_Power tools', 'Siren_Siren'];
const MYSTERIES = ['Unknown Sp._Unknown Sp.'];
const GRAYLIST = [];
const GOLDEN_LIST = []
@@ -209,52 +212,32 @@ class Model {
async setList() {
BLOCKED_IDS = [];
if (this.list === "everything") return
- // Dummy location and week
- const lat = this.lat;
- const lon = this.lon;
- const week = this.week;
- console.log('lat', lat, 'lon', lon, 'week', week)
- this.mdata_input = tf.tensor([lat, lon, week]).expandDims(0);
- const mdata_prediction = this.metadata_model.predict(this.mdata_input);
- const mdata_probs = await mdata_prediction.data();
- const mdata_probs_sorted = mdata_probs.slice().sort().reverse();
- let count = 0
- for (let i = 0; i < mdata_probs.length; i++) {
- if (mdata_probs[i] > this.speciesThreshold) {
- count++;
- DEBUG && console.log("including:", this.labels[i] + ': ' + mdata_probs[i]);
- } else {
- DEBUG && console.log("Excluding:", this.labels[i] + ': ' + mdata_probs[i]);
- // Hack to add Dotterel??
- //if (! this.labels[i].includes('Dotterel'))
- BLOCKED_IDS.push(i)
+ else if (this.list === 'location'){
+ const lat = this.lat;
+ const lon = this.lon;
+ const week = this.week;
+ DEBUG && console.log('lat', lat, 'lon', lon, 'week', week)
+ this.mdata_input = tf.tensor([lat, lon, week]).expandDims(0);
+ const mdata_prediction = this.metadata_model.predict(this.mdata_input);
+ const mdata_probs = await mdata_prediction.data();
+ const mdata_probs_sorted = mdata_probs.slice().sort().reverse();
+ let count = 0
+ for (let i = 0; i < mdata_probs.length; i++) {
+ if (mdata_probs[i] > this.speciesThreshold) {
+ count++;
+ DEBUG && console.log("including:", this.labels[i] + ': ' + mdata_probs[i]);
+ } else {
+ DEBUG && console.log("Excluding:", this.labels[i] + ': ' + mdata_probs[i]);
+ // Hack to add Dotterel??
+ //if (! this.labels[i].includes('Dotterel'))
+ BLOCKED_IDS.push(i)
+ }
}
}
- //console.log('Total species considered at this location: ', count)
- // get the indices of any items in the blacklist, GRAYLIST
- // if (this.list === 'birds') {
- // // find the position of the blocked items in the label list
- // NOT_BIRDS.forEach(notBird => BLOCKED_IDS.push(this.labels.indexOf(notBird)))
- // } else if (this.list === 'migrants') {
- // let v1_migrants;
- // if (this.version === 'v1') {
- // // strip (call) from migrants set
- // v1_migrants = new Set();
- // MIGRANTS.forEach((element) => {
- // const newElement = element.replace(' (call)', '');
- // v1_migrants.add(newElement);
- // })
-
- // }
- // const listToCheck = v1_migrants || MIGRANTS;
- // for (let i = 0; i < this.labels.length; i++) {
- // const item = this.labels[i];
- // if (!listToCheck.has(item) && !MYSTERIES.includes(item)) BLOCKED_IDS.push(i);
- // }
-
- // }
- // GRAYLIST.forEach(species => SUPPRESSED_IDS.push(this.labels.indexOf(species)))
- // GOLDEN_LIST.forEach(species => ENHANCED_IDS.push(this.labels.indexOf(species)))
+ else {
+ // find the position of the blocked items in the label list
+ NOT_BIRDS.forEach(notBird => BLOCKED_IDS.push(this.labels.indexOf(notBird)))
+ }
}
normalize(spec) {
diff --git a/js/ui.js b/js/ui.js
index f8880bc1..1f404685 100644
--- a/js/ui.js
+++ b/js/ui.js
@@ -628,13 +628,14 @@ const displayLocationAddress = async (where) => {
lonEl = document.getElementById('customLon');
placeEl = document.getElementById('customPlace');
address = await fetchLocationAddress(latEl.value, lonEl.value, false);
+ if (address === false) return
placeEl.value = address || 'Location not available';
} else {
-
latEl = document.getElementById('latitude');
lonEl = document.getElementById('longitude');
placeEl = document.getElementById('place');
address = await fetchLocationAddress(latEl.value, lonEl.value, false);
+ if (address === false) return
const content = 'fmd_good ' + address;
placeEl.innerHTML = content;
config.latitude = parseFloat(latEl.value).toFixed(2);
@@ -876,6 +877,10 @@ function postAnalyseMessage(args) {
function fetchLocationAddress(lat, lon) {
+ if (isNaN(lat) || isNaN(lon || lat === '' || lon === '')){
+ alert('Both lat and lon values need to be numbers between 180 and -180')
+ return false
+ }
return new Promise((resolve, reject) => {
if (!LOCATIONS) {
worker.postMessage({ action: 'get-locations', file: currentFile });
@@ -1347,7 +1352,7 @@ window.onload = async () => {
colormap: 'inferno',
timeOfDay: false,
list: 'migrants',
- speciesThreshold: 0.004,
+ speciesThreshold: 0.03,
model: 'v2',
latitude: 52.87,
longitude: 0.89, // Great Snoring :)
@@ -2176,6 +2181,10 @@ listToUse.addEventListener('change', function (e) {
})
speciesThreshold.addEventListener('change', () =>{
+ if (isNaN(speciesThreshold.value) || speciesThreshold.value === '') {
+ alert('The threshold must be a number between 0.001 and 1');
+ return false
+ }
config.speciesThreshold = speciesThreshold.value;
updatePrefs();
worker.postMessage({ action: 'update-state', speciesThreshold: speciesThreshold.value });