huggingface.co
Total runs: 16.2K
24-hour runs: -101
7-day runs: 45
30-day runs: 483
Model's Last Updated: April 16 2025
zero-shot-image-classification

Introduction of AltCLIP

Model Details of AltCLIP

AltCLIP

名称 Name 任务 Task 语言 Language(s) 模型 Model Github
AltCLIP text-image representation 中英文 Chinese&English CLIP FlagAI
简介 Brief Introduction

我们提出了一个简单高效的方法去训练更加优秀的双语CLIP模型。命名为AltCLIP。AltCLIP基于 Stable Diffusiosn 训练,训练数据来自 WuDao数据集 和 LIAON

AltCLIP模型可以为本项目中的AltDiffusion模型提供支持,关于AltDiffusion模型的具体信息可查看 此教程 。

模型代码已经在 FlagAI 上开源,权重位于我们搭建的 modelhub 上。我们还提供了微调,推理,验证的脚本,欢迎试用。

We propose a simple and efficient method to train a better bilingual CLIP model. Named AltCLIP. AltCLIP is trained based on Stable Diffusiosn with training data from WuDao dataset and Liaon .

The AltCLIP model can provide support for the AltDiffusion model in this project. Specific information on the AltDiffusion model can be found in this tutorial .

The model code has been open sourced on FlagAI and the weights are located on modelhub . We also provide scripts for fine-tuning, inference, and validation, so feel free to try them out.

引用

关于AltCLIP,我们已经推出了相关报告,有更多细节可以查阅,如对您的工作有帮助,欢迎引用。

If you find this work helpful, please consider to cite

@article{https://doi.org/10.48550/arxiv.2211.06679,
  doi = {10.48550/ARXIV.2211.06679},
  url = {https://arxiv.org/abs/2211.06679},
  author = {Chen, Zhongzhi and Liu, Guang and Zhang, Bo-Wen and Ye, Fulong and Yang, Qinghong and Wu, Ledell},
  keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences},
  title = {AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities},
  publisher = {arXiv},
  year = {2022},
  copyright = {arXiv.org perpetual, non-exclusive license}
}
训练 Training

训练共有两个阶段。 在平行知识蒸馏阶段,我们只是使用平行语料文本来进行蒸馏(平行语料相对于图文对更容易获取且数量更大)。在双语对比学习阶段,我们使用少量的中-英 图像-文本对(一共约2百万)来训练我们的文本编码器以更好地适应图像编码器。

There are two phases of training. In the parallel knowledge distillation phase, we only use parallel corpus texts for distillation (parallel corpus is easier to obtain and larger in number compared to image text pairs). In the bilingual comparison learning phase, we use a small number of Chinese-English image-text pairs (about 2 million in total) to train our text encoder to better fit the image encoder.

下游效果 Performance
Language Method Text-to-Image Retrival Image-to-Text Retrival MR
R@1 R@5 R@10 R@1 R@5 R@10
English CLIP 65.0 87.1 92.2 85.1 97.3 99.2 87.6
Taiyi 25.3 48.2 59.2 39.3 68.1 79.6 53.3
Wukong - - - - - - -
R2D2 - - - - - - -
CN-CLIP 49.5 76.9 83.8 66.5 91.2 96.0 77.3
AltCLIP 66.3 87.8 92.7 85.9 97.7 99.1 88.3
AltCLIP∗ 72.5 91.6 95.4 86.0 98.0 99.1 90.4
Chinese CLIP 0.0 2.4 4.0 2.3 8.1 12.6 5.0
Taiyi 53.7 79.8 86.6 63.8 90.5 95.9 78.4
Wukong 51.7 78.9 86.3 76.1 94.8 97.5 80.9
R2D2 60.9 86.8 92.7 77.6 96.7 98.9 85.6
CN-CLIP 68.0 89.7 94.4 80.2 96.6 98.2 87.9
AltCLIP 63.7 86.3 92.1 84.7 97.4 98.7 87.2
AltCLIP∗ 69.8 89.9 94.7 84.8 97.4 98.8 89.2

image-20221111172255521

可视化效果 Visualization effects

基于AltCLIP,我们还开发了AltDiffusion模型,可视化效果如下。

Based on AltCLIP, we have also developed the AltDiffusion model, visualized as follows.

模型推理 Inference

Please download the code from FlagAI AltCLIP

from PIL import Image
import requests

# transformers version >= 4.21.0
from modeling_altclip import AltCLIP
from processing_altclip import AltCLIPProcessor

# now our repo's in private, so we need `use_auth_token=True`
model = AltCLIP.from_pretrained("BAAI/AltCLIP")
processor = AltCLIPProcessor.from_pretrained("BAAI/AltCLIP")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)

outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities

Runs of BAAI AltCLIP on huggingface.co

16.2K
Total runs
-101
24-hour runs
-403
3-day runs
45
7-day runs
483
30-day runs

More Information About AltCLIP huggingface.co Model

AltCLIP huggingface.co

AltCLIP huggingface.co is an AI model on huggingface.co that provides AltCLIP's model effect (), which can be used instantly with this BAAI AltCLIP model. huggingface.co supports a free trial of the AltCLIP model, and also provides paid use of the AltCLIP. Support call AltCLIP model through api, including Node.js, Python, http.

AltCLIP huggingface.co Url

https://huggingface.co/BAAI/AltCLIP

BAAI AltCLIP online free

AltCLIP huggingface.co is an online trial and call api platform, which integrates AltCLIP's modeling effects, including api services, and provides a free online trial of AltCLIP, you can try AltCLIP online for free by clicking the link below.

BAAI AltCLIP online free url in huggingface.co:

https://huggingface.co/BAAI/AltCLIP

AltCLIP install

AltCLIP is an open source model from GitHub that offers a free installation service, and any user can find AltCLIP on GitHub to install. At the same time, huggingface.co provides the effect of AltCLIP install, users can directly use AltCLIP installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

AltCLIP install url in huggingface.co:

https://huggingface.co/BAAI/AltCLIP

Url of AltCLIP

AltCLIP huggingface.co Url

Provider of AltCLIP huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

Total runs: 63.2M
Run Growth: -3.1M
Growth Rate: -4.92%
Updated:February 22 2024
huggingface.co

Total runs: 36.3M
Run Growth: 1.4M
Growth Rate: 3.88%
Updated:July 03 2024
huggingface.co

Total runs: 9.9M
Run Growth: -3.1M
Growth Rate: -30.89%
Updated:February 21 2024
huggingface.co

Total runs: 9.8M
Run Growth: -1.7M
Growth Rate: -17.40%
Updated:February 21 2024
huggingface.co

Total runs: 1.9M
Run Growth: 776.0K
Growth Rate: 40.80%
Updated:April 17 2024
huggingface.co

Total runs: 880.4K
Run Growth: -370.2K
Growth Rate: -42.05%
Updated:April 02 2024
huggingface.co

Total runs: 702.7K
Run Growth: -421.5K
Growth Rate: -59.99%
Updated:October 12 2023
huggingface.co

Total runs: 211.0K
Run Growth: -698.9K
Growth Rate: -331.19%
Updated:December 13 2023
huggingface.co

Total runs: 75.2K
Run Growth: 70.9K
Growth Rate: 94.28%
Updated:October 12 2023
huggingface.co

Total runs: 62.3K
Run Growth: -10.6K
Growth Rate: -16.95%
Updated:July 13 2026
huggingface.co

Total runs: 51.3K
Run Growth: -1.2K
Growth Rate: -2.40%
Updated:October 12 2023
huggingface.co

Total runs: 44.8K
Run Growth: -47.5K
Growth Rate: -105.95%
Updated:October 12 2023
huggingface.co

Total runs: 41.1K
Run Growth: -2.6K
Growth Rate: -6.42%
Updated:January 15 2025
huggingface.co

Total runs: 40.1K
Run Growth: 5.8K
Growth Rate: 14.37%
Updated:November 14 2023
huggingface.co

Total runs: 10.3K
Run Growth: 10.3K
Growth Rate: 100.00%
Updated:September 16 2026
huggingface.co

Total runs: 9.4K
Run Growth: -9.6K
Growth Rate: -102.84%
Updated:October 12 2023
huggingface.co

Total runs: 5.5K
Run Growth: -4.9K
Growth Rate: -89.98%
Updated:May 20 2025
huggingface.co

Total runs: 4.7K
Run Growth: 3.2K
Growth Rate: 69.00%
Updated:April 19 2024
huggingface.co

Total runs: 2.5K
Run Growth: 636
Growth Rate: 25.82%
Updated:September 11 2026
huggingface.co

Total runs: 2.4K
Run Growth: 508
Growth Rate: 21.41%
Updated:April 10 2026
huggingface.co

Total runs: 1.9K
Run Growth: -13.4K
Growth Rate: -714.99%
Updated:January 15 2025
huggingface.co

Total runs: 1.8K
Run Growth: 286
Growth Rate: 15.71%
Updated:April 10 2026
huggingface.co

Total runs: 1.8K
Run Growth: 985
Growth Rate: 55.03%
Updated:November 28 2024
huggingface.co

Total runs: 1.7K
Run Growth: 1.3K
Growth Rate: 73.84%
Updated:December 31 2022
huggingface.co

Total runs: 1.3K
Run Growth: 752
Growth Rate: 56.33%
Updated:September 11 2026
huggingface.co

Total runs: 688
Run Growth: -99
Growth Rate: -14.39%
Updated:May 23 2025
huggingface.co

Total runs: 677
Run Growth: -849
Growth Rate: -129.03%
Updated:February 07 2024
huggingface.co

Total runs: 660
Run Growth: -14
Growth Rate: -2.12%
Updated:October 24 2024
huggingface.co

Total runs: 636
Run Growth: -468
Growth Rate: -73.58%
Updated:October 23 2024
huggingface.co

Total runs: 490
Run Growth: -380
Growth Rate: -77.55%
Updated:April 18 2023
huggingface.co

Total runs: 461
Run Growth: -268
Growth Rate: -58.13%
Updated:July 13 2026
huggingface.co

Total runs: 440
Run Growth: 61
Growth Rate: 13.86%
Updated:April 10 2026
huggingface.co

Total runs: 395
Run Growth: -140
Growth Rate: -35.44%
Updated:August 11 2026
huggingface.co

Total runs: 379
Run Growth: 64
Growth Rate: 16.89%
Updated:July 13 2026
huggingface.co

Total runs: 364
Run Growth: -47
Growth Rate: -12.91%
Updated:December 25 2025
huggingface.co

Total runs: 362
Run Growth: 228
Growth Rate: 62.98%
Updated:April 02 2024
huggingface.co

Total runs: 356
Run Growth: -563
Growth Rate: -158.15%
Updated:August 11 2026
huggingface.co

Total runs: 348
Run Growth: -196
Growth Rate: -56.32%
Updated:July 13 2026
huggingface.co

Total runs: 293
Run Growth: -31
Growth Rate: -10.58%
Updated:October 27 2023
huggingface.co

Total runs: 291
Run Growth: -106
Growth Rate: -36.43%
Updated:July 13 2026
huggingface.co

Total runs: 289
Run Growth: 57
Growth Rate: 19.72%
Updated:July 13 2026
huggingface.co

Total runs: 277
Run Growth: -356
Growth Rate: -128.52%
Updated:December 25 2025
huggingface.co

Total runs: 273
Run Growth: 40
Growth Rate: 14.65%
Updated:July 13 2026
huggingface.co

Total runs: 269
Run Growth: -1.9K
Growth Rate: -705.95%
Updated:April 10 2026
huggingface.co

Total runs: 256
Run Growth: 53
Growth Rate: 20.70%
Updated:August 18 2026
huggingface.co

Total runs: 253
Run Growth: -125
Growth Rate: -49.41%
Updated:March 07 2024
huggingface.co

Total runs: 239
Run Growth: -55
Growth Rate: -23.01%
Updated:June 06 2025
huggingface.co

Total runs: 227
Run Growth: 8
Growth Rate: 3.52%
Updated:July 13 2026
huggingface.co

Total runs: 226
Run Growth: 226
Growth Rate: 100.00%
Updated:September 05 2026
huggingface.co

Total runs: 222
Run Growth: -131
Growth Rate: -59.01%
Updated:April 10 2026
huggingface.co

Total runs: 211
Run Growth: 25
Growth Rate: 11.85%
Updated:July 17 2026
huggingface.co

Total runs: 202
Run Growth: 18
Growth Rate: 8.91%
Updated:July 13 2026
huggingface.co

Total runs: 198
Run Growth: 111
Growth Rate: 56.06%
Updated:November 28 2023
huggingface.co

Total runs: 195
Run Growth: 94
Growth Rate: 48.21%
Updated:July 13 2026
huggingface.co

Total runs: 190
Run Growth: -17
Growth Rate: -8.95%
Updated:October 23 2024
huggingface.co

Total runs: 188
Run Growth: 84
Growth Rate: 44.68%
Updated:July 13 2026
huggingface.co

Total runs: 184
Run Growth: 98
Growth Rate: 53.26%
Updated:March 13 2026
huggingface.co

Total runs: 175
Run Growth: -4
Growth Rate: -2.29%
Updated:May 13 2024
huggingface.co

Total runs: 173
Run Growth: 15
Growth Rate: 8.67%
Updated:May 13 2024
huggingface.co

Total runs: 171
Run Growth: 24
Growth Rate: 14.04%
Updated:June 24 2024
huggingface.co

Total runs: 170
Run Growth: 13
Growth Rate: 7.65%
Updated:May 13 2024
huggingface.co

Total runs: 169
Run Growth: 23
Growth Rate: 13.61%
Updated:June 24 2024
huggingface.co

Total runs: 166
Run Growth: 76
Growth Rate: 45.78%
Updated:December 21 2023