Ross Wightman commited on
Commit
11e0f39
1 Parent(s): 96555f5

Initial commit

Browse files
Files changed (4) hide show
  1. README.md +120 -0
  2. config.json +166 -0
  3. open_clip_pytorch_model.bin +3 -0
  4. 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-B/32 - 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-B/32 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,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 512,
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": 512,
31
+ "id2label": {
32
+ "0": "LABEL_0",
33
+ "1": "LABEL_1"
34
+ },
35
+ "initializer_factor": 1.0,
36
+ "initializer_range": 0.02,
37
+ "intermediate_size": 2048,
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": 8,
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
+ },
86
+ "torch_dtype": "float32",
87
+ "transformers_version": null,
88
+ "vision_config": {
89
+ "_name_or_path": "",
90
+ "add_cross_attention": false,
91
+ "architectures": null,
92
+ "attention_dropout": 0.0,
93
+ "bad_words_ids": null,
94
+ "bos_token_id": null,
95
+ "chunk_size_feed_forward": 0,
96
+ "cross_attention_hidden_size": null,
97
+ "decoder_start_token_id": null,
98
+ "diversity_penalty": 0.0,
99
+ "do_sample": false,
100
+ "dropout": 0.0,
101
+ "early_stopping": false,
102
+ "encoder_no_repeat_ngram_size": 0,
103
+ "eos_token_id": null,
104
+ "exponential_decay_length_penalty": null,
105
+ "finetuning_task": null,
106
+ "forced_bos_token_id": null,
107
+ "forced_eos_token_id": null,
108
+ "hidden_act": "gelu",
109
+ "hidden_size": 768,
110
+ "id2label": {
111
+ "0": "LABEL_0",
112
+ "1": "LABEL_1"
113
+ },
114
+ "image_size": 224,
115
+ "initializer_factor": 1.0,
116
+ "initializer_range": 0.02,
117
+ "intermediate_size": 3072,
118
+ "is_decoder": false,
119
+ "is_encoder_decoder": false,
120
+ "label2id": {
121
+ "LABEL_0": 0,
122
+ "LABEL_1": 1
123
+ },
124
+ "layer_norm_eps": 1e-05,
125
+ "length_penalty": 1.0,
126
+ "max_length": 20,
127
+ "min_length": 0,
128
+ "model_type": "clip_vision_model",
129
+ "no_repeat_ngram_size": 0,
130
+ "num_attention_heads": 12,
131
+ "num_beam_groups": 1,
132
+ "num_beams": 1,
133
+ "num_channels": 3,
134
+ "num_hidden_layers": 12,
135
+ "num_return_sequences": 1,
136
+ "output_attentions": false,
137
+ "output_hidden_states": false,
138
+ "output_scores": false,
139
+ "pad_token_id": null,
140
+ "patch_size": 32,
141
+ "prefix": null,
142
+ "problem_type": null,
143
+ "pruned_heads": {},
144
+ "remove_invalid_values": false,
145
+ "repetition_penalty": 1.0,
146
+ "return_dict": true,
147
+ "return_dict_in_generate": false,
148
+ "sep_token_id": null,
149
+ "task_specific_params": null,
150
+ "temperature": 1.0,
151
+ "tf_legacy_loss": false,
152
+ "tie_encoder_decoder": false,
153
+ "tie_word_embeddings": true,
154
+ "tokenizer_class": null,
155
+ "top_k": 50,
156
+ "top_p": 1.0,
157
+ "torch_dtype": null,
158
+ "torchscript": false,
159
+ "transformers_version": "4.21.3",
160
+ "typical_p": 1.0,
161
+ "use_bfloat16": false
162
+ },
163
+ "vision_config_dict": {
164
+ "hidden_act": "gelu"
165
+ }
166
+ }
open_clip_pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bd3c7172de5b207ceac554f5ab5266166f3b9baccc9af5989bc801016d080ad
3
+ size 605219813
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8693edd165efde117185f3e771f1b09bc01f9c19027be4d6d4424bb38f605e4a
3
+ size 605239073