英文

ConvNeXt V2(巨型模型)

ConvNeXt V2是在FCMAE框架上预训练和在ImageNet-22K数据集上进行512x512分辨率微调的模型。它是由Woo等人在论文 ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders 中介绍并首次发布在 this repository 上。

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

模型描述

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

拟议用途和限制

您可以使用原始模型进行图像分类。请查看 model hub 以查找您感兴趣的任务的微调版本。

如何使用

以下是如何使用此模型将COCO 2017数据集的图像分类为1,000个ImageNet类别之一:

from transformers import AutoImageProcessor, ConvNextV2ForImageClassification
import torch
from datasets import load_dataset

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

preprocessor = AutoImageProcessor.from_pretrained("facebook/convnextv2-huge-22k-512")
model = ConvNextV2ForImageClassification.from_pretrained("facebook/convnextv2-huge-22k-512")

inputs = preprocessor(image, return_tensors="pt")

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]),

有关更多代码示例,请参阅 documentation

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}
}