yolo_v4(pretrained: bool = False, overrides: object = {})YOLOv4 — CSPDarknet-53 + SPP + PANet (Bochkovskiy et al., 2020).
Builds the paper-cited full-size YOLOv4 detector: CSPDarknet-53 backbone, SPP module on the final stage, PANet (top-down + bottom-up) neck, and 3-scale detection at strides 8 / 16 / 32 with 3 anchors / scale. Default 80 COCO classes; reaches COCO test-dev AP of 43.5% at 65 fps on Tesla V100 (paper Table 8).
Model Size
Parameters
pretrainedbool= FalseTrue, attempt to load pretrained COCO weights. Currently
raises NotImplementedError.**overridesobject= {}YOLOV4Config.Returns
YOLOV4ForObjectDetectionDetector with the standard YOLOv4 configuration applied (or with
overrides merged on top of it).
Notes
See Bochkovskiy et al., "YOLOv4: Optimal Speed and Accuracy of Object Detection", arXiv 2020 (arXiv:2004.10934). The paper's "bag of specials" includes Mish activation, CIoU loss, DropBlock regularisation, Mosaic augmentation, and CmBN — all motivated by independent prior work that YOLOv4 aggregates and tunes together.
Examples
>>> import lucid
>>> from lucid.models.vision.yolo._v4 import yolo_v4
>>> model = yolo_v4()
>>> x = lucid.randn(1, 3, 608, 608)
>>> out = model(x)
>>> out.logits.shape[0]
1