timm documentation

RepGhost

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

RepGhost

Category: Efficient/Mobile · Code: timm/models/repghost.py · Architectures: 8 · Pretrained weights: 8 (8 with ImageNet-1k results)

RepGhostNet replaces the feature concatenation of the Ghost module with re-parameterized feature reuse, folded into a single convolution path at inference.

Papers

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('repghostnet_200.in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureRepGhostNet
features_only=True feature maps✓ (strides 2, 4, 8, 16, 32)
forward_intermediates()✓
prune_intermediate_layers()✓
Any input size, no changes needed✓
set_input_size()–
dynamic_img_size=True–
set_grad_checkpointing()✓
Layer-wise LR decay (group_matcher())✓
reset_classifier()✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (RepGhostNet with repghostnet_050 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
repghostnet_0502.310.052241
repghostnet_0582.540.062241
repghostnet_0803.270.102241
repghostnet_1004.060.152241
repghostnet_1114.520.182241
repghostnet_1305.460.242241
repghostnet_1506.550.312241
repghostnet_2009.770.532241

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
repghostnet_050.in1k22466.9782241000mittimm
repghostnet_058.in1k22468.9382241000mittimm
repghostnet_080.in1k22472.2402241000mittimm
repghostnet_100.in1k22474.2082241000mittimm
repghostnet_111.in1k22475.0602241000mittimm
repghostnet_130.in1k22476.3782241000mittimm
repghostnet_150.in1k22477.4742241000mittimm
repghostnet_200.in1k22478.8022241000mittimm
Update on GitHub