czczup commited on
Commit
b8178db
1 Parent(s): 0749166

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -0
README.md CHANGED
@@ -1,3 +1,72 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ datasets:
4
+ - laion/laion2B-en
5
+ - laion/laion-coco
6
+ - laion/laion2B-multi
7
+ - kakaobrain/coyo-700m
8
+ - conceptual_captions
9
+ - wanng/wukong100m
10
+ pipeline_tag: image-feature-extraction
11
  ---
12
+
13
+ # Model Card for InternViT-6B-448px-V1-2
14
+
15
+ ## What is InternVL?
16
+
17
+ \[[Paper](https://arxiv.org/abs/2312.14238)\] \[[GitHub](https://github.com/OpenGVLab/InternVL)\] \[[Chat Demo](https://internvl.opengvlab.com/)\]
18
+
19
+ InternVL scales up the ViT to _**6B parameters**_ and aligns it with LLM.
20
+
21
+ It is _**the largest open-source vision/vision-language foundation model (14B)**_ to date, achieving _**32 state-of-the-art**_ performances on a wide range of tasks such as visual perception, cross-modal retrieval, multimodal dialogue, etc.
22
+
23
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64119264f0f81eb569e0d569/k5UATwX5W2b5KJBN5C58x.png)
24
+
25
+ ## Model Details
26
+ - **Model Type:** vision foundation model, feature backbone
27
+ - **Model Stats:**
28
+ - Params (M): 5540 (the last 3 blocks are discarded)
29
+ - Image size: 448 x 448, training with 1 - 12 tiles
30
+ - **Pretrain Dataset:** LAION-en, LAION-COCO, COYO, CC12M, CC3M, SBU, Wukong, LAION-multi, OCR data.
31
+ To enhance the OCR capability of the model, we have incorporated additional OCR data alongside the general caption datasets. Specifically, we utilized PaddleOCR to perform Chinese OCR on images from Wukong and English OCR on images from LAION-COCO.
32
+ - **Note:** InternViT-6B originally had 48 blocks, and we found that using the output after the fourth-to-last block worked best for VLLM. For ease of use and to save GPU memory, we simply discarded the last 3 blocks. Now, the model has only 45 blocks and the number of parameters has been reduced from 5.9B to 5.5B. Therefore, if you want to build a VLLM based on this model, **please make use of the features from the last layer.**
33
+ ## Model Usage (Image Embeddings)
34
+
35
+ ```python
36
+ import torch
37
+ from PIL import Image
38
+ from transformers import AutoModel, CLIPImageProcessor
39
+
40
+ model = AutoModel.from_pretrained(
41
+ 'OpenGVLab/InternViT-6B-448px-V1-5',
42
+ torch_dtype=torch.bfloat16,
43
+ low_cpu_mem_usage=True,
44
+ trust_remote_code=True).cuda().eval()
45
+
46
+ image = Image.open('./examples/image1.jpg').convert('RGB')
47
+
48
+ image_processor = CLIPImageProcessor.from_pretrained('OpenGVLab/InternViT-6B-448px-V1-5')
49
+
50
+ pixel_values = image_processor(images=image, return_tensors='pt').pixel_values
51
+ pixel_values = pixel_values.to(torch.bfloat16).cuda()
52
+
53
+ outputs = model(pixel_values)
54
+ ```
55
+
56
+ ## Citation
57
+
58
+ If you find this project useful in your research, please consider citing:
59
+
60
+ ```BibTeX
61
+ @article{chen2023internvl,
62
+ title={InternVL: Scaling up Vision Foundation Models and Aligning for Generic Visual-Linguistic Tasks},
63
+ author={Chen, Zhe and Wu, Jiannan and Wang, Wenhai and Su, Weijie and Chen, Guo and Xing, Sen and Zhong, Muyan and Zhang, Qinglong and Zhu, Xizhou and Lu, Lewei and Li, Bin and Luo, Ping and Lu, Tong and Qiao, Yu and Dai, Jifeng},
64
+ journal={arXiv preprint arXiv:2312.14238},
65
+ year={2023}
66
+ }
67
+ ```
68
+
69
+
70
+ ## Acknowledgement
71
+
72
+ InternVL is built with reference to the code of the following projects: [OpenAI CLIP](https://github.com/openai/CLIP), [Open CLIP](https://github.com/mlfoundations/open_clip), [CLIP Benchmark](https://github.com/LAION-AI/CLIP_benchmark), [EVA](https://github.com/baaivision/EVA/tree/master), [InternImage](https://github.com/OpenGVLab/InternImage), [ViT-Adapter](https://github.com/czczup/ViT-Adapter), [MMSegmentation](https://github.com/open-mmlab/mmsegmentation), [Transformers](https://github.com/huggingface/transformers), [DINOv2](https://github.com/facebookresearch/dinov2), [BLIP-2](https://github.com/salesforce/LAVIS/tree/main/projects/blip2), [Qwen-VL](https://github.com/QwenLM/Qwen-VL/tree/master/eval_mm), and [LLaVA-1.5](https://github.com/haotian-liu/LLaVA). Thanks for their awesome work!