This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
forked from kahst/BirdNET
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
74 lines (60 loc) · 2.35 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# BirdNET uses eBird checklist frequency data to determine plausible species
# occurrences for a specific location (lat, lon) and one week. An EBIRD_THRESHOLD
# of 0.02 means that a species must occur on at least 2% of all checklists
# for a location to be considered plausible.
EBIRD_SPECIES_CODES = 'metadata/eBird_taxonomy_codes_2018.json'
EBIRD_MDATA = 'metadata/eBird_grid_data_weekly.gz'
USE_EBIRD_CHECKLIST = True
EBIRD_THRESHOLD = 0.02
DEPLOYMENT_LOCATION = (-1, -1)
DEPLOYMENT_WEEK = -1
GRID_STEP_SIZE = 0.25
# We use 3-second spectrograms to identify avian vocalizations.
# You can specify the overlap of consecutive spectrograms and the minimum
# length of a valid signal chunk (in seconds). You can also combine a number
# of extracted spectrograms for each prediction.
SPEC_OVERLAP = 0
SPEC_MINLEN = 1.0
SPECS_PER_PREDICTION = 1
# Adjusting the sigmoid sensitivity of the output layer can increase the
# number of detections (but will most likely also increase the number of
# false positives). You can set a minimum confidence threshold to suppress
# predictions with low score.
# The adjustment of the sigmoid sensitivity of the output layer can lead to an increase
# of detections (but will most likely also increase the number of false positives).
# You can set a minimum confidence threshold to suppress low score predictions.
SENSITIVITY = 1.0
MIN_CONFIDENCE = 0.1
# Loading a snapshot automatically sets the corresponding settings. Do not
# change these settings at runtime!
def setModelSettings(s):
if 'classes' in s:
global CLASSES
CLASSES = s['classes']
if 'spec_type' in s:
global SPEC_TYPE
SPEC_TYPE = s['spec_type']
if 'magnitude_scale' in s:
global MAGNITUDE_SCALE
MAGNITUDE_SCALE = s['magnitude_scale']
if 'sample_rate' in s:
global SAMPLE_RATE
SAMPLE_RATE = s['sample_rate']
if 'win_len' in s:
global WIN_LEN
WIN_LEN = s['win_len']
if 'spec_length' in s:
global SPEC_LENGTH
SPEC_LENGTH = s['spec_length']
if 'spec_fmin' in s:
global SPEC_FMIN
SPEC_FMIN = s['spec_fmin']
if 'spec_fmax' in s:
global SPEC_FMAX
SPEC_FMAX = s['spec_fmax']
if 'im_dim' in s:
global IM_DIM
IM_DIM = s['im_dim']
if 'im_size' in s:
global IM_SIZE
IM_SIZE = s['im_size']