xiangan commited on
Commit
b3c75a2
·
verified ·
1 Parent(s): 45fd221

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +45 -0
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: image-feature-extraction
4
+ ---
5
+ ## RICE-ViT-L Model Card
6
+
7
+
8
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6478679d7b370854241b2ad8/Yy09pOusaZ47LofJ27xox.jpeg)
9
+
10
+ ## Installation
11
+
12
+ ```shell
13
+ pip install torch transformers
14
+ git clone https://github.com/deepglint/unicom
15
+ cd unicom/mlcd
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```python
21
+ from vit_rope2d_hf import MLCDVisionModel
22
+ from transformers import CLIPImageProcessor
23
+ from PIL import Image
24
+ import requests
25
+ import torch
26
+
27
+ # Load model and processor
28
+ model = MLCDVisionModel.from_pretrained("DeepGlint-AI/rice-vit-large-patch14-560")
29
+ processor = CLIPImageProcessor.from_pretrained("DeepGlint-AI/rice-vit-large-patch14-560")
30
+
31
+ # Process single image
32
+ url = "http://images.cocodataset.org/val2017/000000039769.jpg"
33
+ image = Image.open(requests.get(url, stream=True).raw)
34
+ inputs = processor(images=image, return_tensors="pt")
35
+
36
+ # Get visual features
37
+ with torch.no_grad():
38
+ outputs = model(**inputs)
39
+ features = outputs.last_hidden_state
40
+
41
+ print(f"Extracted features shape: {features.shape}")
42
+ ```
43
+
44
+
45
+ ```