pub struct AnalysisSettings {
pub kind: AnalysisKind,
pub num_threads: Option<NonZeroUsize>,
pub model_path: Option<PathBuf>,
}Fields§
§kind: AnalysisKindThe kind of analysis to perform, either “features” or “embedding”. “features” will compute traditional audio features (tempo, key, etc.) “embedding” will compute neural audio embedding using a pre-trained model. Default is “features”.
Note that regardless of this setting, both features and embedding will be computed during analysis. This only determines the kind used for clustering, radio, and other such tasks
num_threads: Option<NonZeroUsize>The number of threads to use for analysis. Default is the number of logical CPUs on the system.
Note that:
- increasing this number may increase memory usage significantly during analysis.
- setting this number to more than the number of logical CPUs will have no effect (saturates at number of logical CPUs).
- leave this unset to use the default.
model_path: Option<PathBuf>You can optionally override the model used for generating audio embeddings. Requirements:
- The model must be in the ONNX format with opset version 16 or higher.
- The model should expect mono audio samples at a sample rate of 22,050 Hz.
- The input tensor must be name “audio” and have shape [B, N] where N a dynamic length corresponding to the number of audio samples in the song, and B is the batch size.
- The output tensor must be name “embedding” and have shape [B, 32] corresponding to a 32-dimensional embedding vector. B is the batch size.
If unset, or a non-existent/invalid path, the built-in model (which is bundled into the daemon binary) will be used.
Trait Implementations§
Source§impl Clone for AnalysisSettings
impl Clone for AnalysisSettings
Source§fn clone(&self) -> AnalysisSettings
fn clone(&self) -> AnalysisSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnalysisSettings
impl Debug for AnalysisSettings
Source§impl Default for AnalysisSettings
impl Default for AnalysisSettings
Source§impl<'de> Deserialize<'de> for AnalysisSettings
impl<'de> Deserialize<'de> for AnalysisSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AnalysisSettings
impl PartialEq for AnalysisSettings
impl Eq for AnalysisSettings
impl StructuralPartialEq for AnalysisSettings
Auto Trait Implementations§
impl Freeze for AnalysisSettings
impl RefUnwindSafe for AnalysisSettings
impl Send for AnalysisSettings
impl Sync for AnalysisSettings
impl Unpin for AnalysisSettings
impl UnwindSafe for AnalysisSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more