pub struct DinoV2Config {
pub hidden_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub img_size: usize,
pub patch_size: usize,
pub mlp_ratio: f64,
pub layer_norm_eps: f64,
pub num_register_tokens: usize,
pub num_classes: usize,
}Expand description
DINOv2 model configuration. vit_giant (SwiGLU MLP) is not yet
supported — vit_small / vit_base / vit_large are.
Fields§
§num_attention_heads: usize§img_size: usize§patch_size: usize§mlp_ratio: f64§layer_norm_eps: f64§num_register_tokens: usize§num_classes: usizeNumber of ImageNet classes for the optional classifier head. Set to 0 to skip the head entirely (encoder-only output).
Implementations§
Source§impl DinoV2Config
impl DinoV2Config
pub fn from_file(path: &Path) -> Result<DinoV2Config, Error>
pub fn new( img_size: usize, depth: usize, embed_dim: usize, num_heads: usize, num_register_tokens: usize, ) -> DinoV2Config
pub fn intermediate_size(&self) -> usize
pub fn head_dim(&self) -> usize
pub fn num_patches(&self) -> usize
pub fn seq_len(&self) -> usize
pub fn patch_dim(&self) -> usize
pub fn vit_small(img_size: usize) -> DinoV2Config
pub fn vit_base(img_size: usize) -> DinoV2Config
pub fn vit_large(img_size: usize) -> DinoV2Config
Trait Implementations§
Source§impl Clone for DinoV2Config
impl Clone for DinoV2Config
Source§fn clone(&self) -> DinoV2Config
fn clone(&self) -> DinoV2Config
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DinoV2Config
impl Debug for DinoV2Config
Source§impl<'de> Deserialize<'de> for DinoV2Config
impl<'de> Deserialize<'de> for DinoV2Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DinoV2Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DinoV2Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DinoV2Config
impl RefUnwindSafe for DinoV2Config
impl Send for DinoV2Config
impl Sync for DinoV2Config
impl Unpin for DinoV2Config
impl UnsafeUnpin for DinoV2Config
impl UnwindSafe for DinoV2Config
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more