data
FastRCNNConfig
extends
ModelConfigFastRCNNConfig(num_classes: int = 80, in_channels: int = 3, roi_size: int = 7, spatial_scale: float = 1.0 / 16.0, dropout: float = 0.5, bbox_reg_weights: tuple[float, float, float, float] = (10.0, 10.0, 5.0, 5.0), score_thresh: float = 0.05, nms_thresh: float = 0.5, max_detections: int = 300)Configuration for Fast R-CNN.
Fast R-CNN (Girshick, ICCV 2015) runs the CNN on the full image once, then extracts per-proposal features with RoI Pooling on the shared feature map. This is the key advance over R-CNN (one forward pass vs one per proposal).
Default backbone: VGG16 conv layers (conv1_1 … conv5_3, pool5 removed). The feature map stride is 16 (four max-pool layers before pool5).
Parameters
num_classesint= 80Foreground object classes. Background is class 0,
giving (num_classes + 1) output logits.
in_channelsint= 3Input image channels (3 for RGB).
roi_sizeint= 7RoI Pool output spatial size (paper: 7 → 7×7).
spatial_scalefloat= 1.0 / 16.0Ratio of feature-map size to input image size.
For VGG16 with pool5 removed: 1/16.
dropoutfloat= 0.5Dropout probability after fc6 and fc7.
bbox_reg_weightstuple[float, float, float, float]= (10.0, 10.0, 5.0, 5.0)Per-component weight scaling for bbox regression
targets (tx, ty, tw, th). Matches the paper's
normalisation by (0, 0, 0, 0) mean / (0.1, 0.1,
0.2, 0.2) std, encoded here as multiplicative
weights.
score_threshfloat= 0.05Minimum class score at inference time.
nms_threshfloat= 0.5Per-class NMS IoU threshold.
max_detectionsint= 300Maximum detections returned per image.
Used by 3
Constructors
1dunder
__init__
→None__init__(num_classes: int = 80, in_channels: int = 3, roi_size: int = 7, spatial_scale: float = 1.0 / 16.0, dropout: float = 0.5, bbox_reg_weights: tuple[float, float, float, float] = (10.0, 10.0, 5.0, 5.0), score_thresh: float = 0.05, nms_thresh: float = 0.5, max_detections: int = 300)