View Source Bumblebee.Vision.DinoV2 (Bumblebee v0.5.3)

DINOv2 model family.

Architectures

  • :base - plain DINOv2 without any head on top

  • :for_image_classification - DINOv2 with head for image classification

  • :backbone - DINOv2 with feature maps output

Inputs

  • "pixel_values" - {batch_size, image_size, image_size, num_channels}

    Featurized image pixel values.

  • "patch_mask" - {batch_size, num_patches}

    Mask to nullify selected embedded patches.

Configuration

  • :image_size - the size of the input spatial dimensions. The model is trained for this size, however the model supports any other input size by interpolating position embeddings . Defaults to 518

  • :num_channels - the number of channels in the input. Defaults to 3

  • :patch_size - the size of the patch spatial dimensions. Defaults to 14

  • :hidden_size - the dimensionality of hidden layers. Defaults to 384

  • :num_blocks - the number of Transformer blocks in the encoder. Defaults to 12

  • :num_attention_heads - the number of attention heads for each attention layer in the encoder. Defaults to 12

  • :intermediate_size_ratio - the dimensionality of the intermediate layer in the transformer feed-forward network (FFN) in the encoder, expressed as a multiplier of :hidden_size . Defaults to 4

  • :use_qkv_bias - whether to use bias in query, key, and value projections. Defaults to true

  • :activation - the activation function. Defaults to :gelu

  • :ffn_swiglu_activation - whether to use the gated SwiGLU activation function in the feed-forward network (FFN). Defaults to false

  • :scale_initial_value - the initial value for scaling layers. Defaults to 1.0

  • :dropout_rate - the dropout rate for encoder and decoder. Defaults to 0.0

  • :attention_dropout_rate - the dropout rate for attention weights. Defaults to 0.0

  • :layer_norm_epsilon - the epsilon used by the layer normalization layers. Defaults to 1.0e-6

  • :initializer_scale - the standard deviation of the normal initializer used for initializing kernel parameters. Defaults to 0.02

  • :backbone_output_indices - list of indices indicating which feature maps to include in the output. If not specified, only the last feature map is included

  • :backbone_use_norm - whether to add layer normalization layer to each of the feature maps returned by the backbone. Defaults to true

  • :output_hidden_states - whether the model should return all hidden states. Defaults to false

  • :output_attentions - whether the model should return all attentions. Defaults to false

  • :num_labels - the number of labels to use in the last layer for the classification task. Defaults to 2

  • :id_to_label - a map from class index to label. Defaults to %{}

References