Ross Wightman
commited on
Commit
•
24fe6be
1
Parent(s):
e2b404d
Add bin files
Browse files- README.md +120 -0
- config.json +174 -0
- open_clip_pytorch_model.bin +3 -0
- pytorch_model.bin +3 -0
README.md
CHANGED
@@ -1,3 +1,123 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
# Model Card for CLIP ViT-L/14 - LAION-2B
|
5 |
+
|
6 |
+
# Table of Contents
|
7 |
+
|
8 |
+
1. [Model Details](#model-details)
|
9 |
+
1. [Uses](#uses)
|
10 |
+
1. [Training Details](#training-details)
|
11 |
+
1. [Evaluation](#evaluation)
|
12 |
+
1. [Citation](#citation)
|
13 |
+
1. [How To Get Started With the Model](#how-to-get-started-with-the-model)
|
14 |
+
|
15 |
+
|
16 |
+
# Model Details
|
17 |
+
|
18 |
+
## Model Description
|
19 |
+
|
20 |
+
A CLIP ViT L/14 model trained with the LAION-2B English subset of LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/open_clip).
|
21 |
+
|
22 |
+
# Uses
|
23 |
+
|
24 |
+
As per the original OpenAI CLIP models, this model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such model.
|
25 |
+
|
26 |
+
The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis. Additionally, the LAION-5B blog (https://laion.ai/blog/laion-5b/) and upcoming paper include additional discussion as it relates specifically to the training dataset.
|
27 |
+
|
28 |
+
## Direct Use
|
29 |
+
|
30 |
+
Zero-shot image classification, image and text retrieval, among others.
|
31 |
+
|
32 |
+
## Downstream Use
|
33 |
+
|
34 |
+
Image classification and other image task fine-tuning, linear probe image classification, image generation guiding and conditioning, among others.
|
35 |
+
|
36 |
+
## Out-of-Scope Use
|
37 |
+
|
38 |
+
As per the OpenAI models,
|
39 |
+
|
40 |
+
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
|
41 |
+
|
42 |
+
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
|
43 |
+
|
44 |
+
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
|
45 |
+
|
46 |
+
Further the above notice, the LAION-5B dataset used in training of these models has additional considerations, see below.
|
47 |
+
|
48 |
+
# Training Details
|
49 |
+
|
50 |
+
## Training Data
|
51 |
+
|
52 |
+
This model was trained with the 2 Billion sample English subset of LAION-5B (https://laion.ai/blog/laion-5b/).
|
53 |
+
|
54 |
+
**IMPORTANT NOTE:** The motivation behind dataset creation is to democratize research and experimentation around large-scale multi-modal model training and handling of uncurated, large-scale datasets crawled from publically available internet. Our recommendation is therefore to use the dataset for research purposes. Be aware that this large-scale dataset is uncurated. Keep in mind that the uncurated nature of the dataset means that collected links may lead to strongly discomforting and disturbing content for a human viewer. Therefore, please use the demo links with caution and at your own risk. It is possible to extract a “safe” subset by filtering out samples based on the safety tags (using a customized trained NSFW classifier that we built). While this strongly reduces the chance for encountering potentially harmful content when viewing, we cannot entirely exclude the possibility for harmful content being still present in safe mode, so that the warning holds also there. We think that providing the dataset openly to broad research and other interested communities will allow for transparent investigation of benefits that come along with training large-scale models as well as pitfalls and dangers that may stay unreported or unnoticed when working with closed large datasets that remain restricted to a small community. Providing our dataset openly, we however do not recommend using it for creating ready-to-go industrial products, as the basic research about general properties and safety of such large-scale models, which we would like to encourage with this release, is still in progress.
|
55 |
+
|
56 |
+
## Training Procedure
|
57 |
+
|
58 |
+
**TODO** - add SLURM script, hparams.
|
59 |
+
|
60 |
+
# Evaluation
|
61 |
+
|
62 |
+
Evaluation done with code in the [LAION CLIP Benchmark suite](https://github.com/LAION-AI/CLIP_benchmark).
|
63 |
+
|
64 |
+
## Testing Data, Factors & Metrics
|
65 |
+
|
66 |
+
### Testing Data
|
67 |
+
|
68 |
+
The testing is performed with VTAB+ (A combination of VTAB (https://arxiv.org/abs/1910.04867) w/ additional robustness datasets) for classification and COCO and Flickr for retrieval.
|
69 |
+
|
70 |
+
**TODO** - more detail
|
71 |
+
|
72 |
+
## Results
|
73 |
+
|
74 |
+
**TODO** - full zero-shot and retrieval benchmark results
|
75 |
+
|
76 |
+
# Citation
|
77 |
+
|
78 |
+
**BibTeX:**
|
79 |
+
|
80 |
+
In addition to forthcoming LAION-5B (https://laion.ai/blog/laion-5b/) paper, please cite:
|
81 |
+
|
82 |
+
OpenAI CLIP paper
|
83 |
+
```
|
84 |
+
@inproceedings{Radford2021LearningTV,
|
85 |
+
title={Learning Transferable Visual Models From Natural Language Supervision},
|
86 |
+
author={Alec Radford and Jong Wook Kim and Chris Hallacy and A. Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
|
87 |
+
booktitle={ICML},
|
88 |
+
year={2021}
|
89 |
+
}
|
90 |
+
```
|
91 |
+
|
92 |
+
OpenCLIP software
|
93 |
+
```
|
94 |
+
@software{ilharco_gabriel_2021_5143773,
|
95 |
+
author = {Ilharco, Gabriel and
|
96 |
+
Wortsman, Mitchell and
|
97 |
+
Wightman, Ross and
|
98 |
+
Gordon, Cade and
|
99 |
+
Carlini, Nicholas and
|
100 |
+
Taori, Rohan and
|
101 |
+
Dave, Achal and
|
102 |
+
Shankar, Vaishaal and
|
103 |
+
Namkoong, Hongseok and
|
104 |
+
Miller, John and
|
105 |
+
Hajishirzi, Hannaneh and
|
106 |
+
Farhadi, Ali and
|
107 |
+
Schmidt, Ludwig},
|
108 |
+
title = {OpenCLIP},
|
109 |
+
month = jul,
|
110 |
+
year = 2021,
|
111 |
+
note = {If you use this software, please cite it as below.},
|
112 |
+
publisher = {Zenodo},
|
113 |
+
version = {0.1},
|
114 |
+
doi = {10.5281/zenodo.5143773},
|
115 |
+
url = {https://doi.org/10.5281/zenodo.5143773}
|
116 |
+
}
|
117 |
+
```
|
118 |
+
|
119 |
+
# How to Get Started with the Model
|
120 |
+
|
121 |
+
Use the code below to get started with the model.
|
122 |
+
|
123 |
+
** TODO ** - Hugging Face transformers, OpenCLIP, and timm getting started snippets
|
config.json
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"CLIPModel"
|
4 |
+
],
|
5 |
+
"initializer_factor": 1.0,
|
6 |
+
"logit_scale_init_value": 2.6592,
|
7 |
+
"model_type": "clip",
|
8 |
+
"projection_dim": 768,
|
9 |
+
"text_config": {
|
10 |
+
"_name_or_path": "",
|
11 |
+
"add_cross_attention": false,
|
12 |
+
"architectures": null,
|
13 |
+
"attention_dropout": 0.0,
|
14 |
+
"bad_words_ids": null,
|
15 |
+
"bos_token_id": 0,
|
16 |
+
"chunk_size_feed_forward": 0,
|
17 |
+
"cross_attention_hidden_size": null,
|
18 |
+
"decoder_start_token_id": null,
|
19 |
+
"diversity_penalty": 0.0,
|
20 |
+
"do_sample": false,
|
21 |
+
"dropout": 0.0,
|
22 |
+
"early_stopping": false,
|
23 |
+
"encoder_no_repeat_ngram_size": 0,
|
24 |
+
"eos_token_id": 2,
|
25 |
+
"exponential_decay_length_penalty": null,
|
26 |
+
"finetuning_task": null,
|
27 |
+
"forced_bos_token_id": null,
|
28 |
+
"forced_eos_token_id": null,
|
29 |
+
"hidden_act": "gelu",
|
30 |
+
"hidden_size": 768,
|
31 |
+
"id2label": {
|
32 |
+
"0": "LABEL_0",
|
33 |
+
"1": "LABEL_1"
|
34 |
+
},
|
35 |
+
"initializer_factor": 1.0,
|
36 |
+
"initializer_range": 0.02,
|
37 |
+
"intermediate_size": 3072,
|
38 |
+
"is_decoder": false,
|
39 |
+
"is_encoder_decoder": false,
|
40 |
+
"label2id": {
|
41 |
+
"LABEL_0": 0,
|
42 |
+
"LABEL_1": 1
|
43 |
+
},
|
44 |
+
"layer_norm_eps": 1e-05,
|
45 |
+
"length_penalty": 1.0,
|
46 |
+
"max_length": 20,
|
47 |
+
"max_position_embeddings": 77,
|
48 |
+
"min_length": 0,
|
49 |
+
"model_type": "clip_text_model",
|
50 |
+
"no_repeat_ngram_size": 0,
|
51 |
+
"num_attention_heads": 12,
|
52 |
+
"num_beam_groups": 1,
|
53 |
+
"num_beams": 1,
|
54 |
+
"num_hidden_layers": 12,
|
55 |
+
"num_return_sequences": 1,
|
56 |
+
"output_attentions": false,
|
57 |
+
"output_hidden_states": false,
|
58 |
+
"output_scores": false,
|
59 |
+
"pad_token_id": 1,
|
60 |
+
"prefix": null,
|
61 |
+
"problem_type": null,
|
62 |
+
"pruned_heads": {},
|
63 |
+
"remove_invalid_values": false,
|
64 |
+
"repetition_penalty": 1.0,
|
65 |
+
"return_dict": true,
|
66 |
+
"return_dict_in_generate": false,
|
67 |
+
"sep_token_id": null,
|
68 |
+
"task_specific_params": null,
|
69 |
+
"temperature": 1.0,
|
70 |
+
"tf_legacy_loss": false,
|
71 |
+
"tie_encoder_decoder": false,
|
72 |
+
"tie_word_embeddings": true,
|
73 |
+
"tokenizer_class": null,
|
74 |
+
"top_k": 50,
|
75 |
+
"top_p": 1.0,
|
76 |
+
"torch_dtype": null,
|
77 |
+
"torchscript": false,
|
78 |
+
"transformers_version": "4.21.3",
|
79 |
+
"typical_p": 1.0,
|
80 |
+
"use_bfloat16": false,
|
81 |
+
"vocab_size": 49408
|
82 |
+
},
|
83 |
+
"text_config_dict": {
|
84 |
+
"hidden_act": "gelu",
|
85 |
+
"hidden_size": 768,
|
86 |
+
"intermediate_size": 3072,
|
87 |
+
"num_attention_heads": 12
|
88 |
+
},
|
89 |
+
"torch_dtype": "float32",
|
90 |
+
"transformers_version": null,
|
91 |
+
"vision_config": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_dropout": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"bos_token_id": null,
|
98 |
+
"chunk_size_feed_forward": 0,
|
99 |
+
"cross_attention_hidden_size": null,
|
100 |
+
"decoder_start_token_id": null,
|
101 |
+
"diversity_penalty": 0.0,
|
102 |
+
"do_sample": false,
|
103 |
+
"dropout": 0.0,
|
104 |
+
"early_stopping": false,
|
105 |
+
"encoder_no_repeat_ngram_size": 0,
|
106 |
+
"eos_token_id": null,
|
107 |
+
"exponential_decay_length_penalty": null,
|
108 |
+
"finetuning_task": null,
|
109 |
+
"forced_bos_token_id": null,
|
110 |
+
"forced_eos_token_id": null,
|
111 |
+
"hidden_act": "gelu",
|
112 |
+
"hidden_size": 1024,
|
113 |
+
"id2label": {
|
114 |
+
"0": "LABEL_0",
|
115 |
+
"1": "LABEL_1"
|
116 |
+
},
|
117 |
+
"image_size": 224,
|
118 |
+
"initializer_factor": 1.0,
|
119 |
+
"initializer_range": 0.02,
|
120 |
+
"intermediate_size": 4096,
|
121 |
+
"is_decoder": false,
|
122 |
+
"is_encoder_decoder": false,
|
123 |
+
"label2id": {
|
124 |
+
"LABEL_0": 0,
|
125 |
+
"LABEL_1": 1
|
126 |
+
},
|
127 |
+
"layer_norm_eps": 1e-05,
|
128 |
+
"length_penalty": 1.0,
|
129 |
+
"max_length": 20,
|
130 |
+
"min_length": 0,
|
131 |
+
"model_type": "clip_vision_model",
|
132 |
+
"no_repeat_ngram_size": 0,
|
133 |
+
"num_attention_heads": 16,
|
134 |
+
"num_beam_groups": 1,
|
135 |
+
"num_beams": 1,
|
136 |
+
"num_channels": 3,
|
137 |
+
"num_hidden_layers": 24,
|
138 |
+
"num_return_sequences": 1,
|
139 |
+
"output_attentions": false,
|
140 |
+
"output_hidden_states": false,
|
141 |
+
"output_scores": false,
|
142 |
+
"pad_token_id": null,
|
143 |
+
"patch_size": 14,
|
144 |
+
"prefix": null,
|
145 |
+
"problem_type": null,
|
146 |
+
"pruned_heads": {},
|
147 |
+
"remove_invalid_values": false,
|
148 |
+
"repetition_penalty": 1.0,
|
149 |
+
"return_dict": true,
|
150 |
+
"return_dict_in_generate": false,
|
151 |
+
"sep_token_id": null,
|
152 |
+
"task_specific_params": null,
|
153 |
+
"temperature": 1.0,
|
154 |
+
"tf_legacy_loss": false,
|
155 |
+
"tie_encoder_decoder": false,
|
156 |
+
"tie_word_embeddings": true,
|
157 |
+
"tokenizer_class": null,
|
158 |
+
"top_k": 50,
|
159 |
+
"top_p": 1.0,
|
160 |
+
"torch_dtype": null,
|
161 |
+
"torchscript": false,
|
162 |
+
"transformers_version": "4.21.3",
|
163 |
+
"typical_p": 1.0,
|
164 |
+
"use_bfloat16": false
|
165 |
+
},
|
166 |
+
"vision_config_dict": {
|
167 |
+
"hidden_act": "gelu",
|
168 |
+
"hidden_size": 1024,
|
169 |
+
"intermediate_size": 4096,
|
170 |
+
"num_attention_heads": 16,
|
171 |
+
"num_hidden_layers": 24,
|
172 |
+
"patch_size": 14
|
173 |
+
}
|
174 |
+
}
|
open_clip_pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ddb47339f44e4fd9cace3d3960d38af1b51a25857440cfae90afc44706d7e2b
|
3 |
+
size 1710631365
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:45a6d8e04e46cfc7f55ee74a62a4ef04c95b9ef005981f9ccee19af8906ab181
|
3 |
+
size 1710660257
|