DarkNetV2¶
The DarkNetV2 model is based on the "YOLO9000: Better, Faster, Stronger" paper.
Architecture overview¶
This paper improves its version version by adding more recent gradient flow facilitators.
The key takeaways from the paper are the following:
- adds batch normalization layers compared to DarkNetV1
Model builders¶
The following model builders can be used to instantiate a DarknetV2 model, with or
without pre-trained weights. All the model builders internally rely on the
DarknetV2 base class.
DarknetV2
¶
DarknetV2(layout: list[tuple[int, int]], num_classes: int = 10, in_channels: int = 3, stem_channels: int = 32, act_layer: Module | None = None, norm_layer: Callable[[int], Module] | None = None, drop_layer: Callable[..., Module] | None = None, conv_layer: Callable[..., Module] | None = None)
Bases: Sequential
Source code in holocron/models/classification/darknetv2.py
darknet19
¶
darknet19(pretrained: bool = False, checkpoint: Checkpoint | None = None, progress: bool = True, **kwargs: Any) -> DarknetV2
Darknet-19 from "YOLO9000: Better, Faster, Stronger"
| PARAMETER | DESCRIPTION |
|---|---|
pretrained
|
If True, returns a model pre-trained on ImageNette
TYPE:
|
checkpoint
|
If specified, the model's parameters will be set to the checkpoint's values
TYPE:
|
progress
|
If True, displays a progress bar of the download to stderr
TYPE:
|
kwargs
|
keyword args of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DarknetV2
|
classification model |
Darknet19_Checkpoint
¶
Bases: Enum
IMAGENETTE
class-attribute
instance-attribute
¶
IMAGENETTE = _checkpoint(arch='darknet19', url='https://github.com/frgfm/Holocron/releases/download/v0.2.1/darknet19_224-32fd3f97.pth', acc1=0.9386, acc5=0.9936, sha256='32fd3f979586556554652d650c44a59747c7762d81140cadbcd795179a3877ec', size=79387724, num_params=19827626, commit='6e32c5b578711a2ef3731a8f8c61760ed9f03e58', train_args='./imagenette2-320/ --arch darknet19 --batch-size 64 --mixup-alpha 0.2 --amp --device 0 --epochs 100 --lr 1e-3 --label-smoothing 0.1 --random-erase 0.1 --train-crop-size 176 --val-resize-size 232 --opt adamw --weight-decay 5e-2')