HuggingFace镜像/convnextv2-tiny-1k-224
模型介绍文件和版本分析

ConvNeXt V2(微型模型)

ConvNeXt V2 模型使用 FCMAE 框架进行预训练,并在分辨率为 224x224 的 ImageNet-1K 数据集上进行微调。该模型由 Woo 等人在论文《ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders》(https://arxiv.org/abs/2301.00808)中提出,并首次在 此仓库 发布。

免责声明:发布 ConvNeXT V2 的团队未为此模型撰写模型卡片,因此本模型卡片由 Hugging Face 团队编写。

模型描述

ConvNeXt V2 是一个纯卷积模型(ConvNet),它为 ConvNeXt 引入了全卷积掩码自编码器框架(FCMAE)和新的全局响应归一化(GRN)层。ConvNeXt V2 显著提升了纯卷积网络在各种识别基准上的性能。

model image

预期用途和局限性

您可以使用原始模型进行图像分类。

如何使用

以下是使用此模型将 COCO 2017 数据集的图像分类为 1000 个 ImageNet 类别之一的方法:

from transformers import AutoImageProcessor, ConvNextV2ForImageClassification
import torch
import openmind
from datasets import load_dataset
device = torch.device('npu' if torch.npu.is_available() else 'cpu')

dataset = load_dataset("examples/cats-image")
image = dataset["test"]["image"][0]

preprocessor = AutoImageProcessor.from_pretrained("openmind/convnextv2-tiny-1k-224")
model = ConvNextV2ForImageClassification.from_pretrained("openmind/convnextv2-tiny-1k-224").to(device)

inputs = preprocessor(image, return_tensors="pt").to(device)

with torch.no_grad():
    logits = model(**inputs).logits

# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label]),

BibTeX 条目和引用信息

@article{DBLP:journals/corr/abs-2301-00808,
  author    = {Sanghyun Woo and
               Shoubhik Debnath and
               Ronghang Hu and
               Xinlei Chen and
               Zhuang Liu and
               In So Kweon and
               Saining Xie},
  title     = {ConvNeXt {V2:} Co-designing and Scaling ConvNets with Masked Autoencoders},
  journal   = {CoRR},
  volume    = {abs/2301.00808},
  year      = {2023},
  url       = {https://doi.org/10.48550/arXiv.2301.00808},
  doi       = {10.48550/arXiv.2301.00808},
  eprinttype = {arXiv},
  eprint    = {2301.00808},
  timestamp = {Tue, 10 Jan 2023 15:10:12 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2301-00808.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
下载使用量0