adirik commited on
Commit
047ca09
·
1 Parent(s): b70cf11

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - vision
5
+ - image-classification
6
+ widget:
7
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
8
+ example_title: Tiger
9
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg
10
+ example_title: Teapot
11
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
12
+ example_title: Palace
13
+ ---
14
+
15
+ # ConvNeXt V2 (large-sized model)
16
+
17
+ ConvNeXt V2 model pretrained using the FCMAE framework and fine-tuned on the ImageNet-22K dataset at resolution 224x224. It was introduced in the paper [ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders](https://arxiv.org/abs/2301.00808) by Woo et al. and first released in [this repository](https://github.com/facebookresearch/ConvNeXt-V2).
18
+
19
+ Disclaimer: The team releasing ConvNeXT V2 did not write a model card for this model so this model card has been written by the Hugging Face team.
20
+
21
+ ## Model description
22
+
23
+ ConvNeXt V2 is a pure convolutional model (ConvNet) that introduces a fully convolutional masked autoencoder framework (FCMAE) and a new Global Response Normalization (GRN) layer to ConvNeXt. ConvNeXt V2 significantly improves the performance of pure ConvNets on various recognition benchmarks.
24
+
25
+ ![model image](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/convnextv2_architecture.png)
26
+
27
+ ## Intended uses & limitations
28
+
29
+ You can use the raw model for image classification. See the [model hub](https://huggingface.co/models?search=convnextv2) to look for
30
+ fine-tuned versions on a task that interests you.
31
+
32
+ ### How to use
33
+
34
+ Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
35
+
36
+ ```python
37
+ from transformers import AutoImageProcessor, ConvNextV2ForImageClassification
38
+ import torch
39
+ from datasets import load_dataset
40
+
41
+ dataset = load_dataset("huggingface/cats-image")
42
+ image = dataset["test"]["image"][0]
43
+
44
+ preprocessor = AutoImageProcessor.from_pretrained("facebook/convnextv2-large-22k-224")
45
+ model = ConvNextV2ForImageClassification.from_pretrained("facebook/convnextv2-large-22k-224")
46
+
47
+ inputs = preprocessor(image, return_tensors="pt")
48
+
49
+ with torch.no_grad():
50
+ logits = model(**inputs).logits
51
+
52
+ # model predicts one of the 1000 ImageNet classes
53
+ predicted_label = logits.argmax(-1).item()
54
+ print(model.config.id2label[predicted_label]),
55
+ ```
56
+
57
+ For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/master/en/model_doc/convnextv2).
58
+
59
+ ### BibTeX entry and citation info
60
+
61
+ ```bibtex
62
+ @article{DBLP:journals/corr/abs-2301-00808,
63
+ author = {Sanghyun Woo and
64
+ Shoubhik Debnath and
65
+ Ronghang Hu and
66
+ Xinlei Chen and
67
+ Zhuang Liu and
68
+ In So Kweon and
69
+ Saining Xie},
70
+ title = {ConvNeXt {V2:} Co-designing and Scaling ConvNets with Masked Autoencoders},
71
+ journal = {CoRR},
72
+ volume = {abs/2301.00808},
73
+ year = {2023},
74
+ url = {https://doi.org/10.48550/arXiv.2301.00808},
75
+ doi = {10.48550/arXiv.2301.00808},
76
+ eprinttype = {arXiv},
77
+ eprint = {2301.00808},
78
+ timestamp = {Tue, 10 Jan 2023 15:10:12 +0100},
79
+ biburl = {https://dblp.org/rec/journals/corr/abs-2301-00808.bib},
80
+ bibsource = {dblp computer science bibliography, https://dblp.org}
81
+ }
82
+ ```