Skip to content

Commit

Permalink
Added additional BirdNET non-avian classes, as found here kahst/BirdN…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Jan 26, 2024
1 parent 137f6bb commit 80ccb19
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 4 deletions.
60 changes: 59 additions & 1 deletion js/BirdNet2.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,65 @@ let myModel;
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'];
'Power tools_Power tools', 'Siren_Siren',"Canis latrans_Coyote",
"Canis lupus_Gray Wolf",
"Gastrophryne carolinensis_Eastern Narrow-mouthed Toad",
"Gastrophryne olivacea_Great Plains Narrow-mouthed Toad",
"Incilius valliceps_Gulf Coast Toad",
"Anaxyrus americanus_American Toad",
"Anaxyrus canorus_Yosemite Toad",
"Anaxyrus cognatus_Great Plains Toad",
"Anaxyrus fowleri_Fowler's Toad",
"Anaxyrus houstonensis_Houston Toad",
"Anaxyrus microscaphus_Arizona Toad",
"Anaxyrus quercicus_Oak Toad",
"Anaxyrus speciosus_Texas Toad",
"Anaxyrus terrestris_Southern Toad",
"Anaxyrus woodhousii_Woodhouse's Toad",
"Dryophytes andersonii_Pine Barrens Treefrog",
"Dryophytes arenicolor_Canyon Treefrog",
"Dryophytes avivoca_Bird-voiced Treefrog",
"Dryophytes chrysoscelis_Cope's Gray Treefrog",
"Dryophytes cinereus_Green Treefrog",
"Dryophytes femoralis_Pine Woods Treefrog",
"Dryophytes gratiosus_Barking Treefrog",
"Dryophytes squirellus_Squirrel Treefrog",
"Dryophytes versicolor_Gray Treefrog",
"Eleutherodactylus planirostris_Greenhouse Frog",
"Hyliola regilla_Pacific Chorus Frog",
"Lithobates catesbeianus_American Bullfrog",
"Lithobates clamitans_Green Frog",
"Lithobates palustris_Pickerel Frog",
"Lithobates sylvaticus_Wood Frog",
"Pseudacris brimleyi_Brimley's Chorus Frog",
"Pseudacris clarkii_Spotted Chorus Frog",
"Pseudacris crucifer_Spring Peeper",
"Pseudacris feriarum_Upland Chorus Frog",
"Pseudacris nigrita_Southern Chorus Frog",
"Pseudacris ocularis_Little Grass Frog",
"Pseudacris ornata_Ornate Chorus Frog",
"Pseudacris streckeri_Strecker's Chorus Frog",
"Pseudacris triseriata_Striped Chorus Frog",
"Acris crepitans_Northern Cricket Frog",
"Acris gryllus_Southern Cricket Frog",
"Eunemobius carolinus_Carolina Ground Cricket",
"Eunemobius confusus_Confused Ground Cricket",
"Gryllus assimilis_Gryllus assimilis",
"Gryllus fultoni_Southern Wood Cricket",
"Gryllus pennsylvanicus_Fall Field Cricket",
"Gryllus rubens_Southeastern Field Cricket",
"Neonemobius cubensis_Cuban Ground Cricket",
"Oecanthus celerinictus_Fast-calling Tree Cricket",
"Oecanthus exclamationis_Davis's Tree Cricket",
"Oecanthus fultoni_Snowy Tree Cricket",
"Oecanthus nigricornis_Blackhorned Tree Cricket",
"Oecanthus niveus_Narrow-winged Tree Cricket",
"Oecanthus pini_Pine Tree Cricket",
"Oecanthus quadripunctatus_Four-spotted Tree Cricket",
"Orocharis saltator_Jumping Bush Cricket",
"Alouatta pigra_Mexican Black Howler Monkey",
"Tamias striatus_Eastern Chipmunk",
"Tamiasciurus hudsonicus_Red Squirrel"];
const MYSTERIES = ['Unknown Sp._Unknown Sp.'];
const GRAYLIST = [];
const GOLDEN_LIST = []
Expand Down
6 changes: 3 additions & 3 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ const getDuration = async (src) => {

const convertFileFormat = (file, destination, size, error) => {
return new Promise(function (resolve) {
const sampleRate = 24_000, channels = 1;
const sampleRate = STATE.model === 'v2.4' ? 48_000 :24_000, channels = 1;
let totalTime;
ffmpeg(file)
.audioChannels(channels)
Expand Down Expand Up @@ -1143,7 +1143,7 @@ async function setupCtx(chunk, header) {
const getPredictBuffers = async ({
file = '', start = 0, end = undefined, worker = undefined
}) => {
let chunkLength = 72_000;
let chunkLength = STATE.model === 'v2.4' ? 144_000 : 72_000;
// Ensure max and min are within range
start = Math.max(0, start);
end = Math.min(metadata[file].duration, end);
Expand Down Expand Up @@ -1372,7 +1372,7 @@ const convertSpecsFromExistingSpecs = async (path) => {

const saveResults2DataSet = ({species}) => {
const rootDirectory = DATASET_SAVE_LOCATION;
sampleRate = 24_000;
sampleRate = STATE.model === 'v2.4' ? 48_000 : 24_000;
const height = 256, width = 384;
let t0 = Date.now()
let promise = Promise.resolve();
Expand Down

0 comments on commit 80ccb19

Please sign in to comment.