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
ProducerSequentialFileReaderconvert_to_mono()get_audio_duration_from_sf()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()
- 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.apply_softmaxPredictionConfig.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.build_single_file_result()EncodingStrategy.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()
- birdnet.acoustic.inference.file_writer module
- birdnet.acoustic.inference.prediction_strategy module
PredictionStrategyPredictionStrategy.build_single_file_result()PredictionStrategy.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()
create_species_blacklist()create_thresholds()
- birdnet.acoustic.inference.process_manager module
ProcessManagerProcessManager.child_death_errorProcessManager.close_queues()ProcessManager.join()ProcessManager.join_logging()ProcessManager.raise_if_child_died()ProcessManager.read_promised()ProcessManager.reap_stopped_readers()ProcessManager.record_child_death()ProcessManager.record_run_error()ProcessManager.run_consumer()ProcessManager.run_errorProcessManager.start()ProcessManager.start_file_analyzer_thread()ProcessManager.start_file_completion_dispatcher_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_for_completion_dispatcher()ProcessManager.wait_until_all_finished()
- birdnet.acoustic.inference.resources module
FileCompletionResourcesInputAnalyzerResourcesInputAnalyzerResources.analyzer_queueInputAnalyzerResources.collect_input_durations()InputAnalyzerResources.create()InputAnalyzerResources.finish_signalInputAnalyzerResources.input_durationsInputAnalyzerResources.input_queueInputAnalyzerResources.max_segment_idx_init_valueInputAnalyzerResources.max_segment_idx_ptrInputAnalyzerResources.reset()InputAnalyzerResources.segments_dtypeInputAnalyzerResources.start_signalInputAnalyzerResources.tot_n_segments_ptr
LoggingResourcesPipelineResourcesPipelineResources.analyzer_resourcesPipelineResources.file_completion_resourcesPipelineResources.logging_resourcesPipelineResources.processing_resourcesPipelineResources.producer_resourcesPipelineResources.reset()PipelineResources.ring_buffer_resourcesPipelineResources.stats_resourcesPipelineResources.worker_resources
ProcessingResourcesProcessingResources.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.create()ProducerResources.finish_signalsProducerResources.input_queueProducerResources.n_finished_pointerProducerResources.n_producersProducerResources.reset()ProducerResources.ring_access_lockProducerResources.start_signalsProducerResources.store_unprocessed_inputs()ProducerResources.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_session_dirStatisticsResources.benchmarkingStatisticsResources.callback_finish_signalStatisticsResources.callback_fnStatisticsResources.callback_queueStatisticsResources.callback_start_signalStatisticsResources.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.store_performance_result()StatisticsResources.track_performanceStatisticsResources.tracking_resultStatisticsResources.use_callbackStatisticsResources.wkr_stats_queue
WorkerResourcesget_iso_time()
- birdnet.acoustic.inference.session module
- birdnet.acoustic.inference.strategy module
InferenceStrategyBaseInferenceStrategyBase.build_single_file_result()InferenceStrategyBase.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()
- Module contents
- birdnet.acoustic.models.perch_v2 package
- Submodules
- birdnet.acoustic.models.perch_v2.model module
AcousticModelPerchV2AcousticModelPerchV2.backend_kwargsAcousticModelPerchV2.backend_typeAcousticModelPerchV2.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.is_custom_modelAcousticModelPerchV2.load()AcousticModelPerchV2.load_custom()AcousticModelPerchV2.model_pathAcousticModelPerchV2.n_speciesAcousticModelPerchV2.predict()AcousticModelPerchV2.predict_arrays()AcousticModelPerchV2.predict_session()AcousticModelPerchV2.species_list
- 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.backend_kwargsAcousticModelV2_4.backend_typeAcousticModelV2_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.is_custom_modelAcousticModelV2_4.load()AcousticModelV2_4.load_custom()AcousticModelV2_4.model_pathAcousticModelV2_4.n_speciesAcousticModelV2_4.predict()AcousticModelV2_4.predict_arrays()AcousticModelV2_4.predict_session()AcousticModelV2_4.species_list
- 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.applies_sigmoid()AcousticRavenBackendFP32V2_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
- Module contents
- birdnet.acoustic.models.v3_0 package
- Submodules
- birdnet.acoustic.models.v3_0.model module
AcousticDownloaderBaseV3_0AcousticModelV3_0AcousticModelV3_0.backend_kwargsAcousticModelV3_0.backend_typeAcousticModelV3_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.is_custom_modelAcousticModelV3_0.load()AcousticModelV3_0.load_custom()AcousticModelV3_0.model_pathAcousticModelV3_0.n_speciesAcousticModelV3_0.predict()AcousticModelV3_0.predict_arrays()AcousticModelV3_0.predict_session()AcousticModelV3_0.species_list
- birdnet.acoustic.models.v3_0.pb module
AcousticPBBackendFP32V3_0AcousticPBBackendFP32V3_0.applies_sigmoid()AcousticPBBackendFP32V3_0.encoding_key()AcousticPBBackendFP32V3_0.encoding_signature_name()AcousticPBBackendFP32V3_0.fixed_input_samples()AcousticPBBackendFP32V3_0.input_key()AcousticPBBackendFP32V3_0.max_batch_size()AcousticPBBackendFP32V3_0.precision()AcousticPBBackendFP32V3_0.prediction_key()AcousticPBBackendFP32V3_0.prediction_signature_name()AcousticPBBackendFP32V3_0.supports_encoding()
AcousticPBDownloaderV3_0AcousticRavenBackendFP32V3_0AcousticRavenBackendFP32V3_0.applies_sigmoid()AcousticRavenBackendFP32V3_0.encoding_key()AcousticRavenBackendFP32V3_0.encoding_signature_name()AcousticRavenBackendFP32V3_0.fixed_input_samples()AcousticRavenBackendFP32V3_0.input_key()AcousticRavenBackendFP32V3_0.max_batch_size()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
AcousticTFBackendCustomFP16V3_0AcousticTFBackendCustomFixedInputFP16V3_0AcousticTFBackendCustomFixedInputNoEmbeddingsFP16V3_0AcousticTFBackendCustomFixedInputNoEmbeddingsV3_0AcousticTFBackendCustomFixedInputV3_0AcousticTFBackendCustomNoEmbeddingsFP16V3_0AcousticTFBackendCustomNoEmbeddingsV3_0AcousticTFBackendCustomV3_0AcousticTFBackendFP16V3_0AcousticTFBackendFP32V3_0AcousticTFDownloaderV3_0
- 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- 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:
Registered enum constant for the supported version.
- Return type:
ACOUSTIC_MODEL_VERSIONS
- classmethod load(model_path, species_list, backend_type, backend_kwargs)¶
- Return type:
Self
- classmethod load_custom(model_path, species_list, backend_type, backend_kwargs, check_validity)¶
- Return type:
Self
- abstractmethod predict(*args, **kwargs)¶
- Return type:
- abstractmethod predict_arrays(*args, **kwargs)¶
- Return type:
- abstractmethod predict_session(*args, **kwargs)¶
- Return type:
- birdnet.acoustic.models.base.resolve_in_graph_sigmoid_options(apply_sigmoid, apply_softmax, sigmoid_sensitivity, model_desc)¶
Map the score options of a model with the sigmoid in its graph onto the pipeline’s.
Returns the
(apply_sigmoid, sigmoid_sensitivity)the session runs with. The graph’s own sigmoid is the result at the default sensitivity, so the pipeline’s sigmoid stays off and the scores leave the model untouched (a second sigmoid would squash every score into [0.5, 0.73]). A non-default sensitivity turns it on: the worker recovers the logits from the scores and runs the pipeline sigmoid on them, exactly as on a logit-output model.apply_sigmoid=Falsereturns the raw model output and ignores the sensitivity, as it does for a logit-output model.A softmax stays rejected: a score saturated at 1.0 recovers to an infinite logit, which the sigmoid clips but a softmax turns into NaN.
- Return type:
tuple[bool,float|None]
- birdnet.acoustic.models.base.validate_batch_size_for_backend(batch_size, backend_type)¶
Reject a batch the backend’s export cannot process.
Anything but an int is left to the session’s own validation.
- Return type:
None
- birdnet.acoustic.models.base.validate_segment_size_for_backend(segment_size_s, sample_rate, backend_type)¶
Reject a segment length the backend’s export cannot process.
Anything but a number is left to the session’s own validation.
- Return type:
None