The various function of the birdnet_model_* family are used to create and initialize diffent BirdNET models. Models will be downloaded if necessary.
birdnet_model_tflite(): creates a tflite-model used for species prediction from audio.
birdnet_model_custom(): loads a custom model for species prediction from audio.
birdnet_model_protobuf(): creates a protobuf model for species prediction from audio that can be run on the GPU (GPU support so far only implemented on Apple Silicon).
birdnet_model_meta(): creates a meta model for species prediction from location and time.
birdnet_model_tflite(
version = "v2.4",
language = "en_us",
tflite_num_threads = NULL
)birdnet_model_custom(
version = "v2.4",
classifier_folder,
classifier_name,
tflite_num_threads = NULL
)
birdnet_model_meta(
version = "v2.4",
language = "en_us",
tflite_num_threads = NULL
)
birdnet_model_protobuf(
version = "v2.4",
language = "en_us",
custom_device = NULL
)
A BirdNET model object, which is an S3 object of class birdnet_model and specific subclasses (e.g., birdnet_model_tflite, birdnet_model_v2_4). This object is a list containing:
py_modelThe underlying Python BirdNET model object.
model_versionThe version string of the model (e.g., "v2.4").
Additional elements specific to the model type:
For birdnet_model_tflite and birdnet_model_meta:
language: The language code used (e.g., "en_us").
tflite_num_threads: The number of TFLite threads used (or NULL).
birdnet_model_custom:
classifier_folder: Path to the custom classifier folder.
classifier_name: Name of the custom classifier.
tflite_num_threads: The number of TFLite threads used (or NULL).
birdnet_model_protobuf:
language: The language code used (e.g., "en_us").
custom_device: The custom device specified (or NULL).
character. The version of BirdNET to use (default is "v2.4", no other versions are currently supported).
character. Specifies the language code to use for the model's text processing. The language must be one of the available languages supported by the BirdNET model.
integer. The number of threads to use for TensorFlow Lite operations. If NULL (default), the default threading behavior will be used. Will be coerced to an integer if possible.
character. Path to the folder containing the custom classifier.
character. Name of the custom classifier.
character. This parameter allows specifying a custom device on which computations should be performed.
If custom_device is not specified (i.e., it has the default value None), the program will attempt to use a GPU (e.g., "/device:GPU:0") by default.
If no GPU is available, it will fall back to using the CPU. By specifying a device string such as "/device:GPU:0" or "/device:CPU:0", the user can explicitly choose the device on which operations should be executed.
Species Prediction from audio
Models created from birdnet_model_tflite(), birdnet_model_custom(), and birdnet_model_protobuf() can be used to predict species within an audio file using predict_species_from_audio_file().
Species prediction from location and time
The birdnet_model_meta() model can be used to predict species occurrence at a specific location and time of the year using predict_species_at_location_and_time().
available_languages() predict_species_from_audio_file() predict_species_at_location_and_time()
# Create a TFLite BirdNET model with 2 threads and English (US) language
if (FALSE) {
birdnet_model <- birdnet_model_tflite(version = "v2.4", language = "en_us", tflite_num_threads = 2)
}
Run the code above in your browser using DataLab