Skip to contents

Convert the embeddings from an acoustic model to a data frame. Each row represents one audio segment. The embedding column is returned as a list of numeric vectors (one per segment).

Usage

# S3 method for class 'birdnet_encoding'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

A BirdNET encoding object (as returned by birdnet_encode()).

row.names

NULL or a character vector giving the row names for the data frame. Not used.

optional

logical. Not used.

...

Additional arguments (ignored).

Value

A data frame containing the embeddings. Columns include input, start_time, end_time, and embedding (a list column of numeric vectors).

Examples

if (FALSE) { # \dontrun{
model <- birdnet_load()
audio_file <- system.file("extdata", "soundscape.mp3",
  package = "birdnetR"
)
enc <- birdnet_encode(model, files = audio_file)
df <- as.data.frame(enc)
# Access the first embedding vector
df$embedding[[1]]
} # }