birdnet.acoustic.models.v3_0 package¶
Submodules¶
birdnet.acoustic.models.v3_0.model module¶
- class birdnet.acoustic.models.v3_0.model.AcousticDownloaderBaseV3_0¶
Bases:
objectMethods
ensure_labels_available
get_lang_file
-
AVAILABLE_LANGUAGES:
OrderedSet[str] = OrderedSet(['bg', 'ca', 'cs', 'cy', 'da', 'de', 'en_us', 'es', 'es_ec', 'es_es', 'es_mx', 'et', 'fa', 'fi', 'fr', 'hr', 'ja', 'lt', 'nl', 'no', 'pl', 'pt', 'pt_pt', 'ru', 'sk', 'sr', 'sv', 'tr', 'uk', 'zh'])¶
- classmethod ensure_labels_available()¶
- Return type:
None
- classmethod get_lang_file(lang)¶
- Return type:
Path
-
AVAILABLE_LANGUAGES:
- class birdnet.acoustic.models.v3_0.model.AcousticModelV3_0(model_path, species_list, is_custom_model, backend_type, backend_kwargs)¶
Bases:
AcousticModelBase- Attributes:
- backend_kwargs
- backend_type
- is_custom_model
- model_path
- n_species
- species_list
Methods
Return the string label that identifies the acoustic model version.
encode
encode_arrays
encode_session
get_embeddings_dim
get_sample_rate
get_segment_size_s
get_segment_size_samples
get_sig_fmax
get_sig_fmin
load
load_custom
predict
predict_arrays
predict_session
- encode(inp, /, *, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, speed=1.0, bandpass_fmin=0, bandpass_fmax=15000, half_precision=False, max_audio_duration_min=None, show_stats=None, progress_callback=None, device='CPU', segment_size_s=3.0)¶
- Return type:
- encode_arrays(inp, /, *, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, speed=1.0, bandpass_fmin=0, bandpass_fmax=15000, half_precision=False, max_audio_duration_min=None, show_stats=None, progress_callback=None, device='CPU', segment_size_s=3.0)¶
- Return type:
- encode_session(*, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, speed=1.0, bandpass_fmin=0, bandpass_fmax=15000, half_precision=False, max_audio_duration_min=None, show_stats=None, progress_callback=None, device='CPU', max_n_files=65536, segment_size_s=3.0)¶
- Return type:
- final classmethod get_embeddings_dim()¶
- Return type:
int
- final classmethod get_sample_rate()¶
- Return type:
int
- final classmethod get_segment_size_s()¶
- Return type:
float
- final classmethod get_segment_size_samples()¶
- Return type:
int
- final classmethod get_sig_fmax()¶
- Return type:
int
- final classmethod get_sig_fmin()¶
- Return type:
int
- final classmethod get_version()¶
Return the string label that identifies the acoustic model version.
- Return type:
Literal['2.4','3.0']
- Returns:
ACOUSTIC_MODEL_VERSIONS: Registered enum constant for the supported version.
- classmethod load(model_path, species_list, backend_type, backend_kwargs)¶
- Return type:
- classmethod load_custom(model_path, species_list, backend_type, backend_kwargs, check_validity)¶
- Return type:
- predict(inp, /, *, top_k=5, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, bandpass_fmin=0, bandpass_fmax=15000, speed=1.0, apply_sigmoid=True, sigmoid_sensitivity=1.0, default_confidence_threshold=0.1, custom_confidence_thresholds=None, custom_species_list=None, half_precision=False, max_audio_duration_min=None, device='CPU', show_stats=None, progress_callback=None, segment_size_s=3.0)¶
- Return type:
- predict_arrays(inp, /, *, top_k=5, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, bandpass_fmin=0, bandpass_fmax=15000, speed=1.0, apply_sigmoid=True, sigmoid_sensitivity=1.0, default_confidence_threshold=0.1, custom_confidence_thresholds=None, custom_species_list=None, half_precision=False, max_audio_duration_min=None, device='CPU', show_stats=None, progress_callback=None, segment_size_s=3.0)¶
- Return type:
- predict_session(*, top_k=5, n_producers=1, n_workers=None, batch_size=1, prefetch_ratio=1, overlap_duration_s=0, speed=1.0, bandpass_fmin=0, bandpass_fmax=15000, apply_sigmoid=True, sigmoid_sensitivity=1.0, default_confidence_threshold=0.1, custom_confidence_thresholds=None, custom_species_list=None, half_precision=False, max_audio_duration_min=None, show_stats=None, progress_callback=None, device='CPU', max_n_files=65536, segment_size_s=3.0)¶
- Return type:
birdnet.acoustic.models.v3_0.pb module¶
- class birdnet.acoustic.models.v3_0.pb.AcousticPBBackendFP32V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
PBBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_key
encoding_signature_name
half_precision
input_key
load
name
precision
predict
prediction_key
prediction_signature_name
supports_cow
supports_encoding
unload
- classmethod encoding_key()¶
- Return type:
str|None
- classmethod encoding_signature_name()¶
- Return type:
str|None
- classmethod input_key()¶
- Return type:
str
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_key()¶
- Return type:
str
- classmethod prediction_signature_name()¶
- Return type:
str
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.pb.AcousticPBDownloaderV3_0¶
Bases:
AcousticDownloaderBaseV3_0Methods
ensure_labels_available
get_lang_file
get_model_path_and_labels
- classmethod get_model_path_and_labels(lang)¶
- Return type:
tuple[Path,OrderedSet[str]]
- class birdnet.acoustic.models.v3_0.pb.AcousticRavenBackendFP32V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
PBBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_key
encoding_signature_name
half_precision
input_key
load
name
precision
predict
prediction_key
prediction_signature_name
supports_cow
supports_encoding
unload
- classmethod encoding_key()¶
- Return type:
str|None
- classmethod encoding_signature_name()¶
- Return type:
str|None
- classmethod input_key()¶
- Return type:
str
- classmethod name()¶
- Return type:
str
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_key()¶
- Return type:
str
- classmethod prediction_signature_name()¶
- Return type:
str
- classmethod supports_encoding()¶
- Return type:
bool
birdnet.acoustic.models.v3_0.tf module¶
- class birdnet.acoustic.models.v3_0.tf.AcousticTFBackendFP16V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
TFBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_out_idx
half_precision
in_idx
load
name
precision
predict
prediction_out_idx
probe_input_size_samples
supports_cow
supports_encoding
unload
- classmethod encoding_out_idx()¶
- Return type:
int|None
- classmethod in_idx()¶
- Return type:
int
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_out_idx()¶
- Return type:
int
- classmethod probe_input_size_samples()¶
- Return type:
int
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.tf.AcousticTFBackendFP32V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
TFBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_out_idx
half_precision
in_idx
load
name
precision
predict
prediction_out_idx
probe_input_size_samples
supports_cow
supports_encoding
unload
- classmethod encoding_out_idx()¶
- Return type:
int|None
- classmethod in_idx()¶
- Return type:
int
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_out_idx()¶
- Return type:
int
- classmethod probe_input_size_samples()¶
- Return type:
int
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.tf.AcousticTFDownloaderV3_0¶
Bases:
AcousticDownloaderBaseV3_0Methods
ensure_labels_available
get_lang_file
get_model_path_and_labels
- classmethod get_model_path_and_labels(lang, precision)¶
- Return type:
tuple[Path,OrderedSet[str]]
birdnet.acoustic.models.v3_0.pt module¶
- class birdnet.acoustic.models.v3_0.pt.AcousticPTBackendFP32V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
TorchBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_out_idx
half_precision
load
name
precision
predict
prediction_out_idx
probe_input_size_samples
supports_cow
supports_encoding
unload
- classmethod encoding_out_idx()¶
- Return type:
int|None
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_out_idx()¶
- Return type:
int
- classmethod probe_input_size_samples()¶
- Return type:
int
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.pt.AcousticPTDownloaderV3_0¶
Bases:
AcousticDownloaderBaseV3_0Methods
ensure_labels_available
get_lang_file
get_model_path_and_labels
- classmethod get_model_path_and_labels(lang, precision)¶
- Return type:
tuple[Path,OrderedSet[str]]
birdnet.acoustic.models.v3_0.onnx module¶
- class birdnet.acoustic.models.v3_0.onnx.AcousticOnnxBackendFP16V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
OnnxBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_out_idx
half_precision
load
name
precision
predict
prediction_out_idx
probe_input_size_samples
supports_cow
supports_encoding
unload
- classmethod encoding_out_idx()¶
- Return type:
int|None
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_out_idx()¶
- Return type:
int
- classmethod probe_input_size_samples()¶
- Return type:
int
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.onnx.AcousticOnnxBackendFP32V3_0(model_path, device_name, half_precision, **kwargs)¶
Bases:
OnnxBackend,VersionedAcousticBackendProtocol- Attributes:
- n_species
Methods
copy_from_device
copy_to_device
encode
encoding_out_idx
half_precision
load
name
precision
predict
prediction_out_idx
probe_input_size_samples
supports_cow
supports_encoding
unload
- classmethod encoding_out_idx()¶
- Return type:
int|None
- classmethod precision()¶
- Return type:
Literal['int8','fp16','fp32']
- classmethod prediction_out_idx()¶
- Return type:
int
- classmethod probe_input_size_samples()¶
- Return type:
int
- classmethod supports_encoding()¶
- Return type:
bool
- class birdnet.acoustic.models.v3_0.onnx.AcousticOnnxDownloaderV3_0¶
Bases:
AcousticDownloaderBaseV3_0Methods
ensure_labels_available
get_lang_file
get_model_path_and_labels
- classmethod get_model_path_and_labels(lang, precision)¶
- Return type:
tuple[Path,OrderedSet[str]]