OWLv2 b16

Click a block to read its description, or select it with Tab and Enter.

OWLv2 b16Open-vocabulary detection, 960 × 960 image, 3 class prompts of 16 tokens. Tensor sizes exclude batch.LibreYOLOOWLv2 b16Open-vocabulary detection, 960 × 960 image, 3 class prompts of 16 tokens. Tensor sizes exclude batch.Vision towerImage3 × 960 × 960Conv2d 16×16 / 16768 channels, bias=FalseFlatten patches3600 × 768Learned CLS1 × 768Concat CLS and patches3601 × 768Position embedding3601 × 768+LayerNorm before encoder3601 × 768Vision encoder block3601 × 768, n=12Post LayerNorm3601 × 768Select CLS and broadcast3600 × 768Select patch tokens3600 × 768Multiply patch × CLS3600 × 768LayerNorm3600 × 768Text towerTokenized class prompts3 × 16 IDs, vocabulary 49,408Token embedding3 × 16 × 512Embedded sequences3 × 16 × 512Position embedding16 × 512+Text encoder block16 × 512 per class, n=12Final LayerNorm3 × 16 × 512Select EOS positionArgmax token ID per classLinear text projection512 to 512, no biasL2 normalize3 × 512Causal attention plus padding mask.Query validity is first token ID > 0.Per-patch class scoringImage patch features3600 × 768Text embeddings3 × 512Linear class embedding768 to 512L2 normalize with epsilon3600 × 512, eps=1e-6L2 normalize with epsilon3 × 512, eps=1e-6Einsum cosine similarity3600 × 3Linear logit shift768 to 1 per patchLinear logit scale768 to 1 per patch+ELU3600 × 1Add 13600 × 1Multiply shifted logits by scale3600 × 3Mask invalid class promptsInvalid scores become dtype minimumReturned logits are per patch and per requested class.Vision encoder blockInput 3601 × 768LayerNorm3601 × 768Multi-head self-attention12 heads+LayerNorm3601 × 768Linear768 to 3072QuickGELU3601 × 3072Linear3072 to 768+Output 3601 × 768Vision self-attentionQuery input3601 × 768Key/value input3601 × 768Linear Q768 to 768Reshape heads12 × 3601 × 64Linear K768 to 768Reshape heads12 × 3601 × 64Linear V768 to 768Reshape heads12 × 3601 × 64MatMul Q K-transpose12 × 3601 × 3601ScaleDivide by sqrt(64)Softmax over keys12 × 3601 × 3601MatMul attention × V12 × 3601 × 64Merge heads3601 × 768Linear output768 to 768Box predictionImage patch features3600 × 768Linear768 to 768GELU3600 × 768Linear768 to 768GELU3600 × 768Linear768 to 4Add grid box biasLogit normalized corner and patch-size priorsSigmoid3600 × 4 normalized cxcywhAll prediction-head Linear layers include bias.Objectness predictionImage patch features3600 × 768Linear768 to 768GELU3600 × 768Linear768 to 768GELU3600 × 768Linear768 to 1Squeeze last axis3600 objectness logitsAll prediction-head Linear layers include bias.Text encoder blockInput 16 × 512LayerNorm16 × 512Multi-head self-attention8 heads+LayerNorm16 × 512Linear512 to 2048QuickGELU16 × 2048Linear2048 to 512+Output 16 × 512Text causal self-attentionQuery input16 × 512Key/value input16 × 512Linear Q512 to 512Reshape heads8 × 16 × 64Linear K512 to 512Reshape heads8 × 16 × 64Linear V512 to 512Reshape heads8 × 16 × 64MatMul Q K-transpose8 × 16 × 16ScaleDivide by sqrt(64)Causal mask16 × 16+Softmax over keys8 × 16 × 16MatMul attention × V8 × 16 × 64Merge heads16 × 512Linear output512 to 512QuickGELUInput xElementwise activationMultiply by 1.702Same shapeSigmoidSame shapeMultiply by original xSame shapeDetection outputsClass logitsSigmoid, max class per patchScore thresholdKeep matching patch predictionsConvert normalized cxcywh to XYXYScale to the original image dimensionsResultsBoxes, confidence and requested class IDsObjectness logits are a separate returned branch.No DETR query decoder or FPN exists in this graph.Variant valuesSizeS / PNp / NvEv / nv / hvEt / nt / htMv / MtDb16960 / 163600 / 3601768 / 12 / 12512 / 12 / 83072 / 2048512l141008 / 145184 / 51851024 / 24 / 16768 / 12 / 124096 / 3072768Nv includes CLS; Np is patch count. Ev/Et: tower widths; nv/nt: repeats; hv/ht: heads; Mv/Mt: MLP widths; D: text projection.Source: libreyolo/models/owlv2/nn.py. Revision a4d0ecc9e17f.libreyolo.com