🚀 ReXNet-2.0x模型
该模型在ImageNette数据集上进行了预训练。ReXNet架构在这篇论文中被首次提出。它主要用于图像分类任务,借助定制的Squeeze - Excitation层有效避免通道冗余问题。
🚀 快速开始
ReXNet - 2.0x模型是一个预训练的图像分类模型,在ImageNette数据集上进行了训练。你可以按照以下步骤安装和使用该模型。
✨ 主要特性
- 预训练:在ImageNette数据集上进行预训练。
- 创新架构:作者的核心思想是在残差块中添加定制的Squeeze - Excitation层,以防止通道冗余。
📦 安装指南
前提条件
安装Holocron需要Python 3.6(或更高版本)以及pip/conda。
最新稳定版本
你可以使用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/rexnet2_0x").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)
📚 详细文档
模型描述
作者的核心思想是在残差块中添加定制的Squeeze - Excitation层,以防止通道冗余。
📄 许可证
本项目采用Apache - 2.0许可证。
📚 引用
原论文
@article{DBLP:journals/corr/abs-2007-00992,
author = {Dongyoon Han and
Sangdoo Yun and
Byeongho Heo and
Young Joon Yoo},
title = {ReXNet: Diminishing Representational Bottleneck on Convolutional Neural
Network},
journal = {CoRR},
volume = {abs/2007.00992},
year = {2020},
url = {https://arxiv.org/abs/2007.00992},
eprinttype = {arXiv},
eprint = {2007.00992},
timestamp = {Mon, 06 Jul 2020 15:26:01 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2007-00992.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}
}