yolo_v2(pretrained: bool = False, overrides: object = {})YOLOv2 / YOLO9000 with Darknet-19 backbone (Redmon & Farhadi, CVPR 2017).
Builds the paper-cited YOLOv2 detector: 19-layer Darknet-19 backbone, 5 anchor priors clustered by k-means on the training set, passthrough space-to-depth layer, and 80 COCO classes by default. At the standard 416x416 input the output grid is 13x13 (stride 32). Approximately 50M parameters; COCO test-dev mAP@.5 of 44.0% (paper Table 4).
Model Size
Parameters
pretrainedbool= FalseReserved for future pretrained-weight loading. Currently ignored.
**overridesobject= {}Keyword overrides forwarded into
YOLOV2Config —
num_classes, num_anchors, anchor priors, score_thresh,
nms_thresh, etc.Returns
YOLOV2ForObjectDetectionDetector with the standard YOLOv2 configuration applied (or with
overrides merged on top of it).
Notes
See Redmon & Farhadi, "YOLO9000: Better, Faster, Stronger", CVPR 2017 (arXiv:1612.08242). The five default anchors come from k-means clustering of VOC / COCO ground-truth boxes (paper Table 1).
Examples
>>> import lucid
>>> from lucid.models.vision.yolo._v2 import yolo_v2
>>> model = yolo_v2()
>>> x = lucid.randn(1, 3, 416, 416)
>>> out = model(x)
>>> out.logits.shape[0]
1