Safetensors
English
ebind
jending12 commited on
Commit
ba3b445
·
verified ·
1 Parent(s): 0fffcb4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +184 -161
README.md CHANGED
@@ -1,37 +1,69 @@
1
  ---
2
- library_name: transformers
3
- tags: []
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  ## Model Details
13
 
14
  ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
 
 
 
 
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
37
 
@@ -39,161 +71,152 @@ This is the model card of a 🤗 transformers model that has been pushed on the
39
 
40
  ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
- [More Information Needed]
57
 
58
  ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
  ## How to Get Started with the Model
71
 
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
 
120
 
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
 
171
  ## Citation [optional]
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
 
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
 
197
  ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
+ license: cc
3
+ datasets:
4
+ - encord-team/E-MM1-100M
5
+ - encord-team/E-MM1-1M
6
+ language:
7
+ - en
8
  ---
9
 
10
+ # Model Card for `ebind-points-vision`
11
+
12
+ ![ebind](https://cdn-uploads.huggingface.co/production/uploads/62a0da842e30aaf94ebaaa12/EohI585GsKe5cFlvWyWAX.png)
13
+
14
+ <div style="display: flex; justify-content: space-between;">
15
+ <div style="flex: 1; padding: 10px;">
16
+ <!-- <a href="todohttps://arxiv.org/abs/YYMM.NNNNN" target="_blank" rel="noreferrer" style="text-decoration:none; ">
17
+ <img src="https://img.shields.io/badge/arXiv-YYMM.NNNNN-b31b1b.svg?logo=arxiv" alt="arXiv Paper" style="vertical-align:middle;">
18
+ </a> -->
19
+ <a href="https://colab.research.google.com/github/encord-team/ebind/blob/main/misc/demo.ipynb" target="_blank" rel="noreferrer" style="text-decoration:none; ">
20
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" style="vertical-align:middle;">
21
+ </a>
22
+ <a href="https://huggingface.co/encord-team/ebind-full" target="_blank" rel="noreferrer" style="text-decoration:none; ">
23
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue" alt="Hugging Face Models" style="vertical-align:middle;">
24
+ </a>
25
+ <a href="https://huggingface.co/datasets/encord-team/E-MM1-100M" target="_blank" rel="noreferrer" style="text-decoration:none; ">
26
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Datasets-blue" alt="Hugging Face Datasets" style="vertical-align:middle;">
27
+ </a>
28
+ <a href="https://e-mm1.github.io" target="_blank" rel="noreferrer" style="text-decoration:none; ">
29
+ <img src="https://img.shields.io/badge/Project%20Page-blue?logo=github" alt="Blog" style="vertical-align:middle;">
30
+ </a>
31
+ <div style="flex:1"></div>
32
+ <a href="https://encord.com/blog/how-we-built-multimodal-dataset-emm1/" target="_blank" rel="noreferrer" style="text-decoration:none; ">
33
+ <img src="https://img.shields.io/badge/%F0%9F%93%96-Blog-blue" alt="Blog" style="vertical-align:middle;">
34
+ </a>
35
+ <a href="https://twitter.com/encord_team" target="_blank" rel="noreferrer" style="text-decoration:none; ">
36
+ <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/encord_team?label=%40encord_team&amp;style=social" style="vertical-align: middle">
37
+ </a>
38
+ <img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-blue" style="vertical-align: middle;">
39
+ </div>
40
+ </div>
41
+
42
+ # EBind: Multi-Modal Embeddings
43
 
44
  ## Model Details
45
 
46
  ### Model Description
47
 
48
+ EBind is a multi-modal embedding model that supports image, video, audio, text, and 3D point cloud inputs. All modalities are projected into a shared embedding space, enabling cross-modal similarity computations.
49
+ The model builds on top of three other models; [Perception Encoder](https://huggingface.co/facebook/PE-Core-L14-336), [ImageBind](https://huggingface.co/nielsr/imagebind-huge), and [Uni3D](https://github.com/baaivision/Uni3D).
50
+ As indicated by the figure in the top, data is first embedded individually by the three said models.
51
+ Audio and 3D point cloud embeddings are successively projected with an MLP into the embedding space of the Perception Encoder.
52
+ The model produces unit-norm embeddings directly usable for similarity comparisons via dot-products ([cosine similarity]).
53
 
54
+ This version loads the 3D points and vision encoders.
55
+ If you would like the version that loads all encoders, please refer to [ebind-full](https://huggingface.co/encord-team/ebind-full), or if you would like the version loads the audio and vision encoders please refer to the [audio-vision](https://huggingface.co/encord-team/ebind-audio-vision) model.
56
 
57
+ - **Developed by:** The Encord ML Team ([ml@encord.com](mailto:ml@encord.com))
58
+ - **Model type:** Multimodal embedding model.
59
+ - **License:** The model is published under the [CC-BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) license.
 
 
 
 
60
 
61
+ ### Model Sources
62
 
63
+ - **Repository:** [Github](https://github.com/encord-team/ebind)
64
+ - **Project Page:** [e-mm1.github.io](https://e-mm1.github.io)
65
+ - **Paper [optional]:** Coming soon.
66
+ - **Demo [optional]:** [Explore the embedding space](https://data.encord.com)
 
67
 
68
  ## Uses
69
 
 
71
 
72
  ### Direct Use
73
 
74
+ The model is intended to be used with direct file-inputs of the said modalities; image, video, 3D, and text. It will produce a 1024 dimension embedding per input, suited for similarity computations.
 
 
 
 
 
 
 
 
 
 
75
 
76
+ **Downstream Use**
77
 
78
+ The model could be used to build multimodal LLMs, generative models, and systems that perceive their surroundings via both visual and point cloud embeddings.
79
 
80
  ## Bias, Risks, and Limitations
81
 
82
+ The model was built on data specified in the paper.
83
+ As such, it will be biased towards data that "lives on the internet."
84
+ For specific use-cases, a subsequent fine-tuning stage may be necessary.
 
 
 
 
 
 
85
 
86
  ## How to Get Started with the Model
87
 
88
+ **Option 1**
89
+ If you want to work within the repository, use [`uv`](https://docs.astral.sh/uv/) to install the necessary dependencies.
90
+
91
+ ```bash
92
+ git clone https://github.com/encord-team/ebind
93
+ cd ebind
94
+ uv sync
95
+ ```
96
+
97
+ **Option 2**
98
+ You can also install it as an external dependency for another project:
99
+
100
+ ```bash
101
+ # Option 2.a
102
+ python -m pip install git@https://github.com/encord-team/ebind
103
+ # Option 2.b; or install a local, editable version
104
+ git clone https://github.com/encord-team/ebind
105
+ cd /path/to/your/project
106
+ python -m pip install -e /path/to/ebind
107
+ ```
108
+
109
+ > [!WARNING]
110
+ > If you are running a project with pytorch=2.8.0, you should install torchcodec=0.7.0 (as opposed to the =0.8.0)
111
+ > which is automatically installed with uv. torchcodec=0.8.* matches pytorch=2.9.0.
112
+
113
+ > [!NOTE]
114
+ > The 3D point cloud backbone has a few custom CUDA kernels that you might want to [compile](#compile-pointnet2-cuda-ops-optional).
115
+ > To do that, you will have to do use Option 1 or Option 2.b above to get a local copy of the repository and compile the kernels.
116
+
117
+ ### Loading the Model
118
+
119
+ ```python
120
+ import torch
121
+ from ebind import EBindModel, EBindProcessor
122
+
123
+ model = EBindModel.from_pretrained("encord-team/ebind-full")
124
+ processor = EBindProcessor.from_pretrained("encord-team/ebind-full")
125
+
126
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
127
+ model = model.to(device).eval()
128
+ processor = processor.to(device)
129
+ ```
130
+
131
+ ### Processing Multi-Modal Inputs
132
+
133
+ ```python
134
+ inputs = {
135
+ "image": ["examples/dog.png", "examples/cat.png"],
136
+ "video": ["examples/dog.mp4", "examples/cat.mp4"],
137
+ "text": ["A dog is howling in the street", "A cat is sleeping on the couch"],
138
+ "points": ["examples/dog_point_cloud.npy", "examples/cat_point_cloud.npy"],
139
+ }
140
+
141
+ with torch.inference_mode():
142
+ batch = processor(inputs, return_tensors="pt") # set text_file_paths=True if passing text file paths instead of strings
143
+ outputs = model.forward(**batch)
144
+ ```
145
+
146
+ ### Computing Cross-Modal Similarities
147
+
148
+ ```python
149
+ keys = list(outputs.keys())
150
+ for i, modality in enumerate(keys):
151
+ for j, modality2 in enumerate(keys[i + 1:]):
152
+ result = outputs[modality] @ outputs[modality2].T
153
+ print(f"{modality} x {modality2}:")
154
+ print(result.cpu().detach().numpy())
155
+ print('='*26)
156
+ ```
157
+
158
+ Expected Output:
159
+
160
+ ```
161
+ image x video similarity:
162
+ [[0.48 0.42]
163
+ [0.41 0.6 ]]
164
+ ==========================
165
+ image x text similarity:
166
+ [[0.16 0.07]
167
+ [0.08 0.14]]
168
+ ==========================
169
+ image x points similarity:
170
+ [[0.2 0.19]
171
+ [0.18 0.19]]
172
+ ==========================
173
+ video x text similarity:
174
+ [[0.26 0.05]
175
+ [0.11 0.14]]
176
+ ==========================
177
+ video x points similarity:
178
+ [[0.24 0.15]
179
+ [0.17 0.26]]
180
+ ==========================
181
+ text x points similarity:
182
+ [[0.19 0.14]
183
+ [0.05 0.18]]
184
+ ==========================
185
+ ```
186
+
187
+ **Note:** The image/video similarity is significantly higher because they share the same vision encoder.
188
+
189
+ ### Compile PointNet2 CUDA ops (optional)
190
+
191
+ If you have CUDA available, consider building the [PointNet2](https://github.com/erikwijmans/Pointnet2_PyTorch/tree/master/pointnet2_ops_lib/pointnet2_ops/_ext-src) custom ops used for embedding point clouds to get faster inference:
192
+
193
+ ```bash
194
+ cd src/ebind/models/uni3d/pointnet2_ops && \
195
+ uv run python -c "import torch,sys; sys.exit(0 if torch.cuda.is_available() else 1)" && \
196
+ MAX_JOBS=$(nproc) uv run python setup.py build_ext --inplace
197
+ ```
198
+
199
+ > We have modified the code slightly in `src/ebind/models/uni3d/pointnet2_ops/pointnet2_utils.py` to
200
+ > have a fallback torch implementation in order for the model to be executable on no-GPU
201
+ > hardware.
202
 
203
  ## Evaluation
204
 
205
+ We have evaluated the model on multiple benchmarks.
206
+ We highlight that EBind is performing close to as well as models 4 and 17 times larger.
 
 
 
 
 
 
 
 
 
 
 
207
 
208
+ ![Summary plot](./summary.jpg)
209
+ **Figure 1:** An average of the 13 benchmarks presented in the two tables below, plotted against model size.
210
 
211
+ ![Table 1: Retrieval benchmarks](./table-1.png)
212
+ ![Table 1: Zero-shot benchmarks](./table-2.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
  ## Citation [optional]
215
 
216
+ **BibTeX:** Coming soon..
 
 
 
 
 
 
217
 
218
+ ## Try it now
219
+ Explore the multimodal E-MM1 dataset behind this model [here](https://data.encord.com/e-mm1/explorer)!
 
 
 
 
 
 
 
 
 
 
 
 
 
220
 
221
  ## Model Card Contact
222
+ Please reach out to [ml@encord.com](mailto:ml@encord.com) with any questions or feedback