How amaralibey/bag-of-queries works
Main Components
a) Input Processing Layer:
• Image input (320x320 or specified dimensions)
• Input transformation pipeline (normalization, resizing)
b) Backbone Networks:
• Support for multiple backbones (ResNet50, DinoV2)
• Local feature extraction component
c) BoQ Architecture:
• Multiple BoQ blocks in cascade
• Learnable queries component
• Cross-attention mechanisms
• Feature refinement paths
d) Output Processing:
• Feature concatenation
• Linear projection
• L2 normalization
• Final descriptor generation
[Input Layer]
• ↓
[Backbone Network]
• ↓
[BoQ Blocks Layer]
• ↓
[Output Processing]
Detailed Component Breakdown
a) Input Processing:
[Raw Image] → [Resize] → [Normalize] → [Tensor Transform]
b) Backbone Section:
[Backbone Network (ResNet50/DinoV2)] → [Local Features]
c) BoQ Block Section (repeat for each block):
[Input Features] → [Feature Refinement] → [Cross-Attention]
• ↑
• [Learnable Queries Bank]
d) Output Section:
[Concatenate Outputs] → [Linear Projection] → [L2 Normalization]
Implementation Details to Highlight
• Dimension transformations (e.g., 1024 → 512 channels)
• Number of queries (e.g., 32 queries)
• Number of attention heads (e.g., 8 heads)
• Final output dimension (16384 or 12288)
Technical Details
• Transformer encoder layers
• Self-attention mechanisms
• Normalization layers (LayerNorm)
• Feature projection paths
Integration Points
• How the model integrates with PyTorch Hub
• Data loading interfaces
• Evaluation endpoints