pvt_v2_b0_cls(pretrained: bool | str = False, weights: PVTv2B0Weights | None = None, overrides: object = {})PVT v2-B0 image classifier (Wang et al., 2022).
Combines the pvt_v2_b0 backbone with a mean pool + single
nn.Linear classification head. Default output is
num_classes=1000 (ImageNet-1k). ~3.7M parameters.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag (PVTv2B0Weights.IN1K); a tag
string → that specific checkpoint. Mutually exclusive with
weights (which wins if both are given).Explicit weights enum member. Takes precedence over
pretrained.**overridesobject= {}Keyword overrides on top of the canonical PVT v2-B0 config.
Returns
PVTForImageClassificationClassifier returning ImageClassificationOutput whose
logits has shape (B, num_classes).
Notes
PVT v2-B0 reaches 70.5% top-1 on ImageNet-1k at 224x224 (Wang
et al., 2022, Table 1). Pretrained weights are converted from
timm's pvt_v2_b0.in1k and hosted under lucid-dl/pvt-v2-b0.
Examples
>>> import lucid
>>> from lucid.models.vision.pvt import pvt_v2_b0_cls
>>> model = pvt_v2_b0_cls(num_classes=1000)
>>> x = lucid.randn(1, 3, 224, 224)
>>> model(x).logits.shape
(1, 1000)