Skip to content

Commit 6f56017

Browse files
authored
Update README.md (#139)
* Update README.md
1 parent 5c27d4a commit 6f56017

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,40 @@ The results of the ImageNet linear probe are as follows:
3333
| MLCD-ViT-bigG-14-224px | 87.1 | [HF:MLCD-ViT-bigG-14-224px](https://huggingface.co/DeepGlint-AI/mlcd-vit-bigG-patch14-224) |
3434

3535

36+
## Quickstart Example
37+
38+
Here is an example of how to use the `MLCDVisionModel` from the Transformers library for feature extraction. Please note that this requires the `transformers` library from the `master` branch. We will update this with a specific version number in the future.
39+
40+
```python
41+
import requests
42+
from PIL import Image
43+
from transformers import AutoProcessor, MLCDVisionModel
44+
45+
import torch
46+
47+
# Load model and processor
48+
model = MLCDVisionModel.from_pretrained("DeepGlint-AI/mlcd-vit-bigG-patch14-448")
49+
processor = AutoProcessor.from_pretrained("DeepGlint-AI/mlcd-vit-bigG-patch14-448")
50+
51+
# Process single image
52+
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
53+
image = Image.open(requests.get(url, stream=True).raw)
54+
inputs = processor(images=image, return_tensors="pt")
55+
56+
# Generate outputs
57+
with torch.no_grad():
58+
outputs = model(**inputs)
59+
60+
# Get visual features
61+
features = outputs.last_hidden_state
62+
63+
print(f"Extracted features shape: {features.shape}")
64+
```
65+
3666

3767
## Latest News
68+
69+
<div>🤗 [2025/04] MLCD bigG has been merged into the Transformers library and can be accessed <a href="https://huggingface.co/docs/transformers/main/en/model_doc/mlcd">here</a>.</div>
3870
<div>💖 [2025/02] We have released the <a href="https://huggingface.co/DeepGlint-AI/mlcd-vit-bigG-patch14-448">MLCD-bigG-14-448px</a> model, which has demonstrated excellent performance within the LLaVA-NeXT framework. You can reproduce these results from here <a href="https://github.com/deepglint/unicom/blob/main/mlcd_vl/scripts/pretrain_mlcd.sh">[1]</a>, <a href="https://github.com/deepglint/unicom/blob/main/mlcd_vl/scripts/finetune_mlcd.sh">[2]</a>.</div>
3971
<div>🎅 [2024/12] We have launched the <a href="https://github.com/deepglint/unicom/tree/main/mlcd_vl/downstream">MLCD-Seg-7B</a>, achieving scores of 85.3/81.5 on RefCOCO[testA/B], 82.9/75.6 on RefCOCO+[testA/B], and 80.5 on RefCOCOg[test].</div>
4072
<div>🤖 [2024/11] We have launched the <a href="#mlcd-embodied">MLCD-Embodied-7B</a>, which can reach the level of GPT-4V in embodied capabilities and possesses excellent general understanding abilities.</div>

0 commit comments

Comments
 (0)