birdnet.acoustic.models package¶
Subpackages¶
- birdnet.acoustic.inference.core package
- Subpackages
- birdnet.acoustic.inference.core.encoding package
- birdnet.acoustic.inference.core.prediction package
- Submodules
- birdnet.acoustic.inference.core.prediction.prediction_benchmarking module
- birdnet.acoustic.inference.core.prediction.prediction_result module
- birdnet.acoustic.inference.core.prediction.prediction_tensor module
- birdnet.acoustic.inference.core.prediction.prediction_worker module
- Module contents
- Submodules
- birdnet.acoustic.inference.core.benchmarking module
FullBenchmarkMetaBaseFullBenchmarkMetaBase.cpu_usage_average_pctFullBenchmarkMetaBase.cpu_usage_maximum_pctFullBenchmarkMetaBase.file_batches_processedFullBenchmarkMetaBase.file_segments_maximumFullBenchmarkMetaBase.hw_cpuFullBenchmarkMetaBase.hw_cpu_logical_coresFullBenchmarkMetaBase.hw_cpu_physical_coresFullBenchmarkMetaBase.hw_hostFullBenchmarkMetaBase.hw_ram_GiBFullBenchmarkMetaBase.mem_memory_usage_average_MiBFullBenchmarkMetaBase.mem_memory_usage_maximum_MiBFullBenchmarkMetaBase.mem_shm_ringsizeFullBenchmarkMetaBase.mem_shm_slots_average_bufferedFullBenchmarkMetaBase.mem_shm_slots_average_busyFullBenchmarkMetaBase.mem_shm_slots_average_filledFullBenchmarkMetaBase.mem_shm_slots_average_freeFullBenchmarkMetaBase.model_backendFullBenchmarkMetaBase.model_is_customFullBenchmarkMetaBase.model_pathFullBenchmarkMetaBase.model_precisionFullBenchmarkMetaBase.model_sample_rateFullBenchmarkMetaBase.model_sig_fmaxFullBenchmarkMetaBase.model_sig_fminFullBenchmarkMetaBase.model_speciesFullBenchmarkMetaBase.model_typeFullBenchmarkMetaBase.model_versionFullBenchmarkMetaBase.param_bandpass_fmaxFullBenchmarkMetaBase.param_bandpass_fminFullBenchmarkMetaBase.param_batch_sizeFullBenchmarkMetaBase.param_devicesFullBenchmarkMetaBase.param_half_precisionFullBenchmarkMetaBase.param_inference_libraryFullBenchmarkMetaBase.param_overlap_secondsFullBenchmarkMetaBase.param_prefetch_ratioFullBenchmarkMetaBase.param_producersFullBenchmarkMetaBase.param_workersFullBenchmarkMetaBase.speed_worker_rtfFullBenchmarkMetaBase.speed_worker_total_audio_per_secondFullBenchmarkMetaBase.speed_worker_total_seg_per_secondFullBenchmarkMetaBase.speed_worker_xrtFullBenchmarkMetaBase.speed_worker_xrt_maxFullBenchmarkMetaBase.sw_litert_availableFullBenchmarkMetaBase.sw_osFullBenchmarkMetaBase.sw_package_versionFullBenchmarkMetaBase.sw_python_implementationFullBenchmarkMetaBase.sw_python_versionFullBenchmarkMetaBase.sw_start_methodFullBenchmarkMetaBase.sw_tf_availableFullBenchmarkMetaBase.time_isoFullBenchmarkMetaBase.time_rampup_first_lineFullBenchmarkMetaBase.to_dict()FullBenchmarkMetaBase.worker_busy_averageFullBenchmarkMetaBase.worker_wait_time_average_milliseconds
MinimalBenchmarkMetaBaseMinimalBenchmarkMetaBase.file_countMinimalBenchmarkMetaBase.file_duration_averageMinimalBenchmarkMetaBase.file_duration_maximumMinimalBenchmarkMetaBase.file_duration_minimumMinimalBenchmarkMetaBase.file_duration_sumMinimalBenchmarkMetaBase.file_formatsMinimalBenchmarkMetaBase.file_segments_totalMinimalBenchmarkMetaBase.mem_result_total_memory_usage_MiBMinimalBenchmarkMetaBase.mem_shm_size_audio_samples_MiBMinimalBenchmarkMetaBase.mem_shm_size_batch_sizes_MiBMinimalBenchmarkMetaBase.mem_shm_size_file_indices_MiBMinimalBenchmarkMetaBase.mem_shm_size_flags_MiBMinimalBenchmarkMetaBase.mem_shm_size_segment_indices_MiBMinimalBenchmarkMetaBase.mem_shm_size_total_MiBMinimalBenchmarkMetaBase.model_segment_duration_secondsMinimalBenchmarkMetaBase.speed_total_audio_per_secondMinimalBenchmarkMetaBase.speed_total_rtfMinimalBenchmarkMetaBase.speed_total_seg_per_secondMinimalBenchmarkMetaBase.speed_total_xrtMinimalBenchmarkMetaBase.time_beginMinimalBenchmarkMetaBase.time_endMinimalBenchmarkMetaBase.time_wall_time
- birdnet.acoustic.inference.core.consumer module
- birdnet.acoustic.inference.core.input_analyzer module
- birdnet.acoustic.inference.core.perf_tracker module
AcousticProgressStatsAcousticProgressStats.buffer_statsAcousticProgressStats.cpu_usage_max_pctAcousticProgressStats.cpu_usage_pctAcousticProgressStats.est_remaining_time_hhmmssAcousticProgressStats.est_remaining_time_sAcousticProgressStats.finishedAcousticProgressStats.memory_usage_MiBAcousticProgressStats.memory_usage_max_MiBAcousticProgressStats.processed_batchesAcousticProgressStats.processed_segmentsAcousticProgressStats.producer_statsAcousticProgressStats.progress_pctAcousticProgressStats.speed_seg_per_sAcousticProgressStats.speed_xrtAcousticProgressStats.total_segmentsAcousticProgressStats.wall_time_sAcousticProgressStats.worker_stats
BufferStatsPerformanceTrackerPerformanceTrackingResultPerformanceTrackingResult.avg_busy_slotsPerformanceTrackingResult.avg_busy_workersPerformanceTrackingResult.avg_cpu_usages_pctPerformanceTrackingResult.avg_free_slotsPerformanceTrackingResult.avg_memory_usages_MiBPerformanceTrackingResult.avg_preloaded_slotsPerformanceTrackingResult.avg_wait_time_msPerformanceTrackingResult.max_cpu_usages_pctPerformanceTrackingResult.max_memory_usages_MiBPerformanceTrackingResult.n_usage_recordingsPerformanceTrackingResult.total_batches_processedPerformanceTrackingResult.total_segments_processedPerformanceTrackingResult.worker_avg_wall_time_sPerformanceTrackingResult.worker_speed_xrtPerformanceTrackingResult.worker_speed_xrt_max
ProducerStatsProgressDispatcherValueTrackerWorkerStats
- birdnet.acoustic.inference.core.producer module
Producercalculate_target_sample_count()convert_to_mono()get_audio_duration_from_sf()get_audio_duration_s()get_audio_n_samples()get_audio_n_samples_from_sf()get_data_segments_with_overlap()get_file_segments_with_overlap()get_sample_rate_from_sf()get_segments_with_overlap()get_segments_with_overlap_all_int()get_segments_with_overlap_samples()get_sf_info()read_data_in_mono()read_file_in_mono()resample_array_by_sr()resample_array_by_stretching()to_float32()
- birdnet.acoustic.inference.core.result_base module
AcousticResultBaseAcousticResultBase.hop_duration_sAcousticResultBase.input_durationsAcousticResultBase.inputsAcousticResultBase.memory_size_MiBAcousticResultBase.model_fmaxAcousticResultBase.model_fminAcousticResultBase.model_srAcousticResultBase.n_inputsAcousticResultBase.overlap_duration_sAcousticResultBase.segment_duration_sAcousticResultBase.speedAcousticResultBase.to_arrow_table()AcousticResultBase.to_csv()AcousticResultBase.to_dataframe()AcousticResultBase.to_parquet()AcousticResultBase.to_structured_array()
ModelBaseSessionBaseget_session_id()get_session_id_hash()
- birdnet.acoustic.inference.core.tensor module
- birdnet.acoustic.inference.core.worker module
- Module contents
- Subpackages
- birdnet.acoustic.inference package
- Submodules
- birdnet.acoustic.inference.benchmarking module
- birdnet.acoustic.inference.configs module
EncodingConfigFilteringConfigInferenceConfigModelConfigModelConfig.backend_kwargsModelConfig.backend_typeModelConfig.is_customModelConfig.n_speciesModelConfig.pathModelConfig.sample_rateModelConfig.segment_size_sModelConfig.segment_size_samplesModelConfig.sig_fmaxModelConfig.sig_fminModelConfig.species_listModelConfig.validate_backend_supports_embeddings()ModelConfig.version
OutputConfigPredictionConfigPredictionConfig.apply_sigmoidPredictionConfig.custom_confidence_thresholdsPredictionConfig.custom_species_listPredictionConfig.default_confidence_thresholdPredictionConfig.sigmoid_sensitivityPredictionConfig.top_kPredictionConfig.validate_custom_confidence_thresholds()PredictionConfig.validate_custom_species_list()PredictionConfig.validate_default_confidence_threshold()PredictionConfig.validate_sigmoid_sensitivity()PredictionConfig.validate_top_k()
ProcessingConfigProcessingConfig.batch_sizeProcessingConfig.deviceProcessingConfig.half_precisionProcessingConfig.max_audio_duration_minProcessingConfig.max_n_filesProcessingConfig.n_slotsProcessingConfig.overlap_duration_sProcessingConfig.prefetch_ratioProcessingConfig.producersProcessingConfig.speedProcessingConfig.validate_batch_size()ProcessingConfig.validate_device()ProcessingConfig.validate_half_precision()ProcessingConfig.validate_max_audio_duration_min()ProcessingConfig.validate_max_n_files()ProcessingConfig.validate_n_producers()ProcessingConfig.validate_n_workers()ProcessingConfig.validate_overlap_duration()ProcessingConfig.validate_prefetch_ratio()ProcessingConfig.validate_speed()ProcessingConfig.workers
SpecificConfigBase
- birdnet.acoustic.inference.encoding_strategy module
EncodingStrategyEncodingStrategy.create_array_result()EncodingStrategy.create_files_result()EncodingStrategy.create_full_benchmark_meta()EncodingStrategy.create_minimal_benchmark_meta()EncodingStrategy.create_tensor()EncodingStrategy.create_workers()EncodingStrategy.get_benchmark_dir_name()EncodingStrategy.save_results_extra()EncodingStrategy.validate_config()
- birdnet.acoustic.inference.file_writer module
- birdnet.acoustic.inference.prediction_strategy module
PredictionStrategyPredictionStrategy.create_array_result()PredictionStrategy.create_files_result()PredictionStrategy.create_full_benchmark_meta()PredictionStrategy.create_minimal_benchmark_meta()PredictionStrategy.create_tensor()PredictionStrategy.create_workers()PredictionStrategy.get_benchmark_dir_name()PredictionStrategy.get_top_k()PredictionStrategy.save_results_extra()PredictionStrategy.validate_config()
create_species_blacklist()create_thresholds()
- birdnet.acoustic.inference.process_manager module
ProcessManagerProcessManager.join()ProcessManager.join_logging()ProcessManager.run_consumer()ProcessManager.start()ProcessManager.start_file_analyzer_thread()ProcessManager.start_file_logging_thread()ProcessManager.start_performance_tracker_process()ProcessManager.start_processing()ProcessManager.start_producer_processes()ProcessManager.start_progress_dispatcher_thread()ProcessManager.start_worker_processes()ProcessManager.wait_until_all_finished()
- birdnet.acoustic.inference.resources module
InputAnalyzerResourcesInputAnalyzerResources.analyzer_queueInputAnalyzerResources.collect_input_durations()InputAnalyzerResources.create()InputAnalyzerResources.finish_signalInputAnalyzerResources.finishedInputAnalyzerResources.input_durationsInputAnalyzerResources.input_queueInputAnalyzerResources.max_segment_idx_init_valueInputAnalyzerResources.max_segment_idx_ptrInputAnalyzerResources.reset()InputAnalyzerResources.segments_dtypeInputAnalyzerResources.start_signalInputAnalyzerResources.tot_n_segments_ptrInputAnalyzerResources.unprocessed_inputs
LoggingResourcesPipelineResourcesProcessingResourcesProcessingResources.cancel_eventProcessingResources.create()ProcessingResources.current_run_nrProcessingResources.end_eventProcessingResources.increment_run_nr()ProcessingResources.is_first_runProcessingResources.processing_finished_eventProcessingResources.reset()ProcessingResources.update_interval
ProducerResourcesProducerResources.all_finishedProducerResources.collect_unprocessed_inputs()ProducerResources.create()ProducerResources.finish_signalsProducerResources.input_queueProducerResources.n_finished_pointerProducerResources.n_producersProducerResources.reset()ProducerResources.ring_access_lockProducerResources.start_signalsProducerResources.unprocessed_inputsProducerResources.unprocessed_inputs_queue
ResourceManagerRingBufferResourcesRingBufferResources.create()RingBufferResources.delete_ring_variables()RingBufferResources.reset()RingBufferResources.rf_audio_samplesRingBufferResources.rf_batch_sizesRingBufferResources.rf_file_indicesRingBufferResources.rf_flagsRingBufferResources.rf_segment_indicesRingBufferResources.sem_filled_slotsRingBufferResources.sem_free_slotsRingBufferResources.set_all_flags_writeable()RingBufferResources.shared_memory_context()
StatisticsResourcesStatisticsResources.benchmark_dirStatisticsResources.benchmark_dir_nameStatisticsResources.benchmark_session_dirStatisticsResources.benchmarkingStatisticsResources.callback_finish_signalStatisticsResources.callback_fnStatisticsResources.callback_queueStatisticsResources.callback_start_signalStatisticsResources.collect_performance_results()StatisticsResources.create()StatisticsResources.end_timepointStatisticsResources.perf_res_finish_signalStatisticsResources.perf_res_queueStatisticsResources.perf_res_start_signalStatisticsResources.prd_stats_queueStatisticsResources.reset()StatisticsResources.save_end_time()StatisticsResources.sem_active_workersStatisticsResources.startStatisticsResources.start_iso_timeStatisticsResources.start_timeStatisticsResources.start_timepointStatisticsResources.stopStatisticsResources.track_performanceStatisticsResources.tracking_resultStatisticsResources.use_callbackStatisticsResources.wkr_stats_queue
WorkerResourcesget_iso_time()
- birdnet.acoustic.inference.session module
- birdnet.acoustic.inference.strategy module
InferenceStrategyBaseInferenceStrategyBase.create_array_result()InferenceStrategyBase.create_files_result()InferenceStrategyBase.create_full_benchmark_meta()InferenceStrategyBase.create_minimal_benchmark_meta()InferenceStrategyBase.create_tensor()InferenceStrategyBase.create_workers()InferenceStrategyBase.get_benchmark_dir_name()InferenceStrategyBase.save_results_extra()InferenceStrategyBase.validate_config()
- Module contents
- birdnet.acoustic.models.perch_v2 package
- Submodules
- birdnet.acoustic.models.perch_v2.model module
AcousticModelPerchV2AcousticModelPerchV2.encode()AcousticModelPerchV2.encode_arrays()AcousticModelPerchV2.encode_session()AcousticModelPerchV2.get_embeddings_dim()AcousticModelPerchV2.get_sample_rate()AcousticModelPerchV2.get_segment_size_s()AcousticModelPerchV2.get_segment_size_samples()AcousticModelPerchV2.get_sig_fmax()AcousticModelPerchV2.get_sig_fmin()AcousticModelPerchV2.get_version()AcousticModelPerchV2.load()AcousticModelPerchV2.load_custom()AcousticModelPerchV2.predict()AcousticModelPerchV2.predict_arrays()AcousticModelPerchV2.predict_session()
- birdnet.acoustic.models.perch_v2.pb module
AcousticPBBackendFP32PerchV2AcousticPBBackendFP32PerchV2.encoding_key()AcousticPBBackendFP32PerchV2.encoding_signature_name()AcousticPBBackendFP32PerchV2.input_key()AcousticPBBackendFP32PerchV2.precision()AcousticPBBackendFP32PerchV2.prediction_key()AcousticPBBackendFP32PerchV2.prediction_signature_name()AcousticPBBackendFP32PerchV2.supports_encoding()
AcousticPBDownloaderPerchV2AcousticPBDownloaderPerchV2.LABELS_HEADERAcousticPBDownloaderPerchV2.MODEL_DOWNLOAD_SIZE_CPUAcousticPBDownloaderPerchV2.MODEL_DOWNLOAD_SIZE_GPUAcousticPBDownloaderPerchV2.MODEL_DOWNLOAD_URL_CPUAcousticPBDownloaderPerchV2.MODEL_DOWNLOAD_URL_GPUAcousticPBDownloaderPerchV2.get_model_path_and_labels()
check_tf_version_for_perch_v2()
- Module contents
- birdnet.acoustic.models.v2_4 package
- Submodules
- birdnet.acoustic.models.v2_4.model module
AcousticDownloaderBaseV2_4AcousticModelV2_4AcousticModelV2_4.encode()AcousticModelV2_4.encode_arrays()AcousticModelV2_4.encode_session()AcousticModelV2_4.get_embeddings_dim()AcousticModelV2_4.get_sample_rate()AcousticModelV2_4.get_segment_size_s()AcousticModelV2_4.get_segment_size_samples()AcousticModelV2_4.get_sig_fmax()AcousticModelV2_4.get_sig_fmin()AcousticModelV2_4.get_version()AcousticModelV2_4.load()AcousticModelV2_4.load_custom()AcousticModelV2_4.predict()AcousticModelV2_4.predict_arrays()AcousticModelV2_4.predict_session()
- birdnet.acoustic.models.v2_4.pb module
AcousticPBBackendFP32V2_4AcousticPBBackendFP32V2_4.encoding_key()AcousticPBBackendFP32V2_4.encoding_signature_name()AcousticPBBackendFP32V2_4.input_key()AcousticPBBackendFP32V2_4.precision()AcousticPBBackendFP32V2_4.prediction_key()AcousticPBBackendFP32V2_4.prediction_signature_name()AcousticPBBackendFP32V2_4.supports_encoding()
AcousticPBDownloaderV2_4AcousticRavenBackendFP32V2_4AcousticRavenBackendFP32V2_4.encoding_key()AcousticRavenBackendFP32V2_4.encoding_signature_name()AcousticRavenBackendFP32V2_4.input_key()AcousticRavenBackendFP32V2_4.name()AcousticRavenBackendFP32V2_4.precision()AcousticRavenBackendFP32V2_4.prediction_key()AcousticRavenBackendFP32V2_4.prediction_signature_name()AcousticRavenBackendFP32V2_4.supports_encoding()
- birdnet.acoustic.models.v2_4.tf module
AcousticTFBackendFP16V2_4AcousticTFBackendFP32CustomAppendHiddenV2_4AcousticTFBackendFP32CustomAppendHiddenV2_4.encoding_out_idx()AcousticTFBackendFP32CustomAppendHiddenV2_4.in_idx()AcousticTFBackendFP32CustomAppendHiddenV2_4.precision()AcousticTFBackendFP32CustomAppendHiddenV2_4.prediction_out_idx()AcousticTFBackendFP32CustomAppendHiddenV2_4.supports_encoding()
AcousticTFBackendFP32CustomAppendV2_4AcousticTFBackendFP32CustomReplaceHiddenV2_4AcousticTFBackendFP32CustomReplaceHiddenV2_4.encoding_out_idx()AcousticTFBackendFP32CustomReplaceHiddenV2_4.in_idx()AcousticTFBackendFP32CustomReplaceHiddenV2_4.precision()AcousticTFBackendFP32CustomReplaceHiddenV2_4.prediction_out_idx()AcousticTFBackendFP32CustomReplaceHiddenV2_4.supports_encoding()
AcousticTFBackendFP32V2_4AcousticTFBackendInt8V2_4AcousticTFDownloaderV2_4
- Module contents
- birdnet.acoustic.models.v3_0 package
- Submodules
- birdnet.acoustic.models.v3_0.model module
AcousticDownloaderBaseV3_0AcousticModelV3_0AcousticModelV3_0.encode()AcousticModelV3_0.encode_arrays()AcousticModelV3_0.encode_session()AcousticModelV3_0.get_embeddings_dim()AcousticModelV3_0.get_sample_rate()AcousticModelV3_0.get_segment_size_s()AcousticModelV3_0.get_segment_size_samples()AcousticModelV3_0.get_sig_fmax()AcousticModelV3_0.get_sig_fmin()AcousticModelV3_0.get_version()AcousticModelV3_0.load()AcousticModelV3_0.load_custom()AcousticModelV3_0.predict()AcousticModelV3_0.predict_arrays()AcousticModelV3_0.predict_session()
- birdnet.acoustic.models.v3_0.pb module
AcousticPBBackendFP32V3_0AcousticPBBackendFP32V3_0.encoding_key()AcousticPBBackendFP32V3_0.encoding_signature_name()AcousticPBBackendFP32V3_0.input_key()AcousticPBBackendFP32V3_0.precision()AcousticPBBackendFP32V3_0.prediction_key()AcousticPBBackendFP32V3_0.prediction_signature_name()AcousticPBBackendFP32V3_0.supports_encoding()
AcousticPBDownloaderV3_0AcousticRavenBackendFP32V3_0AcousticRavenBackendFP32V3_0.encoding_key()AcousticRavenBackendFP32V3_0.encoding_signature_name()AcousticRavenBackendFP32V3_0.input_key()AcousticRavenBackendFP32V3_0.name()AcousticRavenBackendFP32V3_0.precision()AcousticRavenBackendFP32V3_0.prediction_key()AcousticRavenBackendFP32V3_0.prediction_signature_name()AcousticRavenBackendFP32V3_0.supports_encoding()
- birdnet.acoustic.models.v3_0.tf module
- birdnet.acoustic.models.v3_0.pt module
- birdnet.acoustic.models.v3_0.onnx module
- Module contents
Submodules¶
birdnet.acoustic.models.base module¶
- class birdnet.acoustic.models.base.AcousticModelBase(model_path, species_list, is_custom_model, backend_type, backend_kwargs)¶
Bases:
ModelBase,ABC- 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_sample_rate
get_segment_size_s
get_segment_size_samples
get_sig_fmax
get_sig_fmin
load
load_custom
predict
predict_arrays
predict_session
- property backend_kwargs: dict[str, Any]¶
- property backend_type: type[VersionedAcousticBackendProtocol]¶
- abstractmethod encode(*args, **kwargs)¶
- Return type:
- abstractmethod encode_arrays(*args, **kwargs)¶
- Return type:
- abstractmethod encode_session(*args, **kwargs)¶
- Return type:
- abstractmethod classmethod get_sample_rate()¶
- Return type:
int
- abstractmethod classmethod get_segment_size_s()¶
- Return type:
float
- abstractmethod classmethod get_segment_size_samples()¶
- Return type:
int
- abstractmethod classmethod get_sig_fmax()¶
- Return type:
int
- abstractmethod classmethod get_sig_fmin()¶
- Return type:
int
- abstractmethod 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.
- abstractmethod predict(*args, **kwargs)¶
- Return type:
- abstractmethod predict_arrays(*args, **kwargs)¶
- Return type:
- abstractmethod predict_session(*args, **kwargs)¶
- Return type: