许可协议: apache-2.0
标签:
- 图像分类
- pytorch
- onnx
数据集:
- frgfm/imagenette
RepVGG-A0模型
该模型在ImageNette数据集上进行了预训练。RepVGG架构由这篇论文提出。
模型描述
作者的核心思想是将训练架构(带有快捷连接)与推理架构(纯高速网络)区分开来。通过设计残差块,训练架构可以被重新参数化为一系列简单的卷积和非线性激活。
安装
前提条件
需要Python 3.6(或更高版本)和pip或conda来安装Holocron。
最新稳定版本
您可以通过pypi安装该软件包的最后一个稳定版本:
pip install pylocron
或使用conda:
conda install -c frgfm pylocron
开发者模式
如果您希望使用尚未发布的最新功能,可以从源代码安装该软件包(首先安装Git):
git clone https://github.com/frgfm/Holocron.git
pip install -e Holocron/.
使用说明
from PIL import Image
from torchvision.transforms import Compose, ConvertImageDtype, Normalize, PILToTensor, Resize
from torchvision.transforms.functional import InterpolationMode
from holocron.models import model_from_hf_hub
model = model_from_hf_hub("frgfm/repvgg_a0").eval()
img = Image.open(path_to_an_image).convert("RGB")
config = model.default_cfg
transform = Compose([
Resize(config['input_shape'][1:], interpolation=InterpolationMode.BILINEAR),
PILToTensor(),
ConvertImageDtype(torch.float32),
Normalize(config['mean'], config['std'])
])
input_tensor = transform(img).unsqueeze(0)
with torch.inference_mode():
output = model(input_tensor)
probs = output.squeeze(0).softmax(dim=0)
引用
原始论文
@article{DBLP:journals/corr/abs-2101-03697,
author = {Xiaohan Ding and
Xiangyu Zhang and
Ningning Ma and
Jungong Han and
Guiguang Ding and
Jian Sun},
title = {RepVGG: Making VGG-style ConvNets Great Again},
journal = {CoRR},
volume = {abs/2101.03697},
year = {2021},
url = {https://arxiv.org/abs/2101.03697},
eprinttype = {arXiv},
eprint = {2101.03697},
timestamp = {Tue, 09 Feb 2021 15:29:34 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-2101-03697.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
本实现的来源
@software{Fernandez_Holocron_2020,
author = {Fernandez, François-Guillaume},
month = {5},
title = {{Holocron}},
url = {https://github.com/frgfm/Holocron},
year = {2020}
}