bfshi-nvidia commited on
Commit
5551bf0
·
verified ·
1 Parent(s): c79738f

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/example_selection_maps/bottom_up_selection_prob.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/example_selection_maps/top_down_selection_prob_1.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/example_selection_maps/top_down_selection_prob_2.png filter=lfs diff=lfs merge=lfs -text
39
+ assets/ps3_siglip2_performance.png filter=lfs diff=lfs merge=lfs -text
40
+ assets/test_images/dock.jpg filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ language:
4
+ - en
5
+ base_model:
6
+ - google/siglip2-so400m-patch14-384
7
+ pipeline_tag: image-feature-extraction
8
+ ---
9
+
10
+ ## Description: <br>
11
+
12
+ PS3_Lang-1.5K-SigLIP2 is a vision encoder that extracts visual features from images of up to 1.5K resolution.
13
+
14
+ This model is for research and development only.
15
+
16
+ ### License/Terms of Use: <br>
17
+
18
+ Governing Terms: [CC-BY-NC-SA-4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en). Additional Information: [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/) for [Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct).
19
+
20
+ ### Deployment Geography:
21
+
22
+ Global
23
+
24
+ ### Use Case: <br>
25
+
26
+ The model is used for extracting visual features from high-resolution images.
27
+
28
+ ### Release Date: <br>
29
+
30
+ Huggingface [07/26/2025] via [https://huggingface.co/nvidia/PS3_Lang-1.5K-SigLIP2] <br>
31
+
32
+ ## Reference(s):
33
+
34
+ The model is from the paper [Scaling Vision Pre-Training to 4K Resolution](https://arxiv.org/abs/2503.19903). Useful links:
35
+
36
+ [![website](https://img.shields.io/badge/website-76b900?style=for-the-badge&logo=safari&labelColor=555555)](https://nvlabs.github.io/PS3/)
37
+ [![Arxiv](https://img.shields.io/badge/Arxiv-b31b1b?style=for-the-badge&logo=arxiv&labelColor=555555)](https://arxiv.org/abs/2503.19903)
38
+ [![VILA-HD Demo](https://img.shields.io/badge/-VILA--HD_Demo-brightgreen?style=for-the-badge&logo=huggingface&labelColor=555555&color=ff6e00)](https://huggingface.co/spaces/bfshi/VILA-HD-demo)
39
+ [![PS3 Models](https://img.shields.io/badge/PS3%20Models%20-ffd21e?style=for-the-badge&logo=huggingface&labelColor=555555)](https://huggingface.co/collections/nvidia/ps3-scaling-vision-pre-training-to-4k-resolution-682d0535b61c07afd45242e9)
40
+ [![VILA-HD Models](https://img.shields.io/badge/VILA--HD%20Models%20-ffd21e?style=for-the-badge&logo=huggingface&labelColor=555555)](https://huggingface.co/collections/nvidia/ps3-scaling-vision-pre-training-to-4k-resolution-682d0535b61c07afd45242e9)
41
+ [![PS3 Code](https://img.shields.io/badge/PS3%20Code%20-181717?style=for-the-badge&logo=github&labelColor=555555)](https://github.com/NVlabs/PS3)
42
+
43
+
44
+ ## Model Architecture:
45
+ **Architecture Type:** Neural Network
46
+
47
+ **Network Architecture:** Vision Transformer designed for high-resolution images
48
+
49
+ This model was developed based on [SigLIP2](https://huggingface.co/google/siglip2-so400m-patch14-384). Please see training designs in the paper.
50
+
51
+
52
+ ## Input: <br>
53
+ **Input Type(s):** Image <br>
54
+ **Input Format:** Red, Green, Blue (RGB) <br>
55
+ **Input Parameters:** Two-Dimensional (2D) <br>
56
+ **Other Properties Related to Input:** Image resolutions up to 1512*1512. <br>
57
+
58
+ ## Output: <br>
59
+ **Output Type(s):** Embeddings <br>
60
+ **Output Format:** Tensor <br>
61
+ **Output Parameters:** One-Dimensional (1D) <br>
62
+ **Other Properties Related to Output:** Downstream model required to leverage image features <br>
63
+
64
+ Our AI models are designed and/or optimized to run on NVIDIA GPU-accelerated systems. By leveraging NVIDIA’s hardware (e.g. GPU cores) and software frameworks (e.g., CUDA libraries), the model achieves faster training and inference times compared to CPU-only solutions. <br>
65
+
66
+ ## Software Integration:
67
+ **Runtime Engine(s):**
68
+ Not Applicable (N/A) <br>
69
+
70
+ **Supported Hardware Microarchitecture Compatibility:** <br>
71
+ NVIDIA Ampere <br>
72
+ NVIDIA Blackwell <br>
73
+ NVIDIA Jetson <br>
74
+ NVIDIA Hopper <br>
75
+
76
+ **Preferred/Supported Operating System(s):**
77
+ Linux <br>
78
+ Linux 4 Tegra <br>
79
+ QNX <br>
80
+ Windows <br>
81
+
82
+ ## Model Version(s):
83
+
84
+ v1.0 - Initial release
85
+
86
+ ## Pre-Trained Models
87
+
88
+ ### PS3 models
89
+
90
+ | Vision Model | Max Resolution | Pre-Trained Weights |
91
+ |-----------------|----------------|-------------------------------------------------------------------------|
92
+ | PS3-1.5K-SigLIP | 1512 * 1512 | [nvidia/PS3-1.5K-SigLIP](https://huggingface.co/nvidia/PS3-1.5K-SigLIP) |
93
+ | PS3-4K-SigLIP | 3780 * 3780 | [nvidia/PS3-4K-SigLIP](https://huggingface.co/nvidia/PS3-4K-SigLIP) |
94
+ | PS3-1.5K-C-RADIOv2 | 1536 * 1536 | [nvidia/PS3-1.5K-C-RADIOv2](https://huggingface.co/nvidia/PS3-1.5K-C-RADIOv2) |
95
+ | PS3-4K-C-RADIOv2 | 3840 * 3840 | [nvidia/PS3-4K-C-RADIOv2](https://huggingface.co/nvidia/PS3-4K-C-RADIOv2) |
96
+ | PS3-1.5K-SigLIP2 | 1512 * 1512 | [nvidia/PS3-1.5K-SigLIP2](https://huggingface.co/nvidia/PS3-1.5K-SigLIP2) |
97
+ | PS3-4K-SigLIP2 | 3780 * 3780 | [nvidia/PS3-4K-SigLIP2](https://huggingface.co/nvidia/PS3-4K-SigLIP2) |
98
+ | PS3_Lang-1.5K-SigLIP2 | 1512 * 1512 | [nvidia/PS3_Lang-1.5K-SigLIP2](https://huggingface.co/nvidia/PS3_Lang-1.5K-SigLIP2) |
99
+ | PS3_Lang-4K-SigLIP2 | 3780 * 3780 | [nvidia/PS3_Lang-4K-SigLIP2](https://huggingface.co/nvidia/PS3_Lang-4K-SigLIP2) |
100
+
101
+ ### Performance
102
+
103
+ ![PS3-1.5K-SigLIP2 Performance](assets/ps3_siglip2_performance.png)
104
+
105
+ ## Training Datasets: <br>
106
+
107
+ Pre-training includes 75M images from 1 dataset that's built based on:
108
+ - SA-1B (https://ai.meta.com/datasets/segment-anything/)
109
+ - IDL (https://huggingface.co/datasets/pixparse/idl-wds)
110
+
111
+ Language alignment stage includes 72 datasets. See [Dataset Preparation](https://arxiv.org/abs/2412.04468) for more details.
112
+
113
+ Training: 100% <br>
114
+
115
+ ## Training Dataset:
116
+
117
+ **Link:**
118
+ We used the following dataset during pre-training stage:
119
+ - SA-1B (https://ai.meta.com/datasets/segment-anything/)
120
+ - IDL (https://huggingface.co/datasets/pixparse/idl-wds)
121
+
122
+ We use the following dataset during language alignment stage:
123
+ See [Dataset Preparation](https://arxiv.org/abs/2412.04468) for more details.
124
+
125
+ **Data Collection Method by dataset:** <br>
126
+ [Hybrid: Automated, Human]
127
+
128
+ **Labeling Method by dataset:** <br>
129
+ [Hybrid: Automated, Human]
130
+
131
+ **Properties (Quantity, Dataset Descriptions, Sensor(s)):** <br>
132
+ Pre-training: 75M images with resolution up to 4Kx4K.
133
+ Language alignment: 72 datasets splitted into 5 stages (Projector Alignment, Vision Encoder Alignment, Pre-Training, Image Instruction-Tuning, and Patch Selection Tuning) <br>
134
+
135
+ ## Testing & Evaluation Datasets:
136
+ * None <br>
137
+
138
+
139
+ ## Performance
140
+
141
+ ### Performance of PS3 models
142
+
143
+ See Table 1 in the paper for full results.
144
+
145
+ ## Inference:
146
+ **Acceleration Engine:** Not Applicable (N/A) <br>
147
+ **Test Hardware:** <br>
148
+ The model is tested on NVIDIA A100 GPU.
149
+
150
+ ## Installation
151
+
152
+ Install through pip to use PS3 out of the box.
153
+ ```bash
154
+ pip install ps3-torch
155
+ ```
156
+
157
+ If you would like to make changes to the PS3 code, go to [PS3 repository](https://github.com/NVlabs/PS3), clone the repo, and install in editable mode.
158
+ ```bash
159
+ cd PS3
160
+ pip install -e .
161
+ ```
162
+
163
+ ## Inference - Quick Start
164
+
165
+ Here we show example usage including
166
+ - loading the model
167
+ - selectively encoding high-res image based on image saliency (bottom-up selection) and visualizing the selection probabilities
168
+ - selectively encoding high-res image based on text prompts (top-down selection) and visualizing the selection probabilities
169
+ - formatting the encoded features into (masked) feature maps
170
+
171
+ ### 1. Load Model and Image
172
+ ```python
173
+ from PIL import Image
174
+ from ps3 import PS3VisionModel, PS3ImageProcessor
175
+
176
+ # Load the PS3 model and processor.
177
+ vision_model = PS3VisionModel.from_pretrained("nvidia/PS3-4K-SigLIP2")
178
+ processor = PS3ImageProcessor.from_pretrained("nvidia/PS3-4K-SigLIP2")
179
+ vision_model.cuda().eval()
180
+
181
+ # You can replace it with your own image.
182
+ image = Image.open("assets/test_images/dock.jpg")
183
+
184
+ # Preprocess the image.
185
+ x = processor(image)["pixel_values"][0].unsqueeze(0).cuda()
186
+ ```
187
+
188
+ ### 2. Encode High-Res Image with Bottom-Up Selection
189
+
190
+ PS3 can select important high-res patches based on visual saliency and encode those patches.
191
+
192
+ **You can encode the whole high-res image using PS3.**
193
+ ```python
194
+ outs = vision_model(x, num_look_close="all")
195
+ features = outs.last_hidden_state
196
+ print(features.shape) # (1, 88209, 1152)
197
+ ```
198
+ Note the PS3-4K model processes the image at multiple scales: 378 (low-res), 756, 1512, and 3780, and it has a patch size of 14.
199
+
200
+ Then the number of tokens at each scale is (378/14)^2 = 729, (756/14)^2 = 2916, (1512/14)^2 = 11664, and (3780/14)^2 = 72900.
201
+
202
+ The output hidden state concatenates all the tokens along sequence dimension.
203
+ That gives us 729 + 2916 + 11664 + 72900 = 88209 tokens in total.
204
+
205
+ **You can encode parts of the high-res image by setting `num_look_close`, i.e., how many times to run the high-res selection and encoding.**
206
+ ```python
207
+ outs = vision_model(x, num_look_close=2)
208
+ features = outs.last_hidden_state
209
+ print(features.shape) # (1, 5849, 1152)
210
+ ```
211
+ In this example, it only runs the high-res selection and encoding twice.
212
+
213
+ Note that PS3 processes at most 2560 high-res patches at a time. Then running high-res selection and encoding twice gives us 2560 * 2 = 5120 high-res tokens. There is also 729 low-res tokens. That gives us 729 + 5120 = 5849 tokens in total.
214
+
215
+ **You can also decide how many high-res tokens to process by setting `num_token_look_close`.**
216
+ ```python
217
+ outs = vision_model(x, num_token_look_close=3000)
218
+ features = outs.last_hidden_state
219
+ print(features.shape) # (1, 3729, 1152)
220
+ ```
221
+ In this example, it only processes 3000 high-res tokens. Note that PS3 only processes 2560 high-res patches at a time. This means it needs to run the high-res selection and encoding twice, with the first time processing 2560 high-res tokens and the second time processing 440 tokens. In the end it outputs 3729 tokens (3000 high-res + 729 low-res).
222
+
223
+ **Visualize the bottom-up patch selection probabilities.**
224
+ ```python
225
+ ############## Helper functions for visiualization ##############
226
+
227
+ # install cv2, matplotlib, scipy for visualization purpose
228
+ os.system("pip install opencv-python matplotlib scipy")
229
+ from torchvision import transforms
230
+ import numpy as np
231
+ import os
232
+ import cv2
233
+ import matplotlib.pyplot as plt
234
+ from scipy.ndimage import gaussian_filter
235
+
236
+ def create_heatmap_overlay(image, heatmap, alpha=0.4, colormap=plt.cm.jet, sigma=10.0):
237
+ if len(image.shape) == 2:
238
+ image = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)
239
+
240
+ smoothed_heatmap = gaussian_filter(heatmap.astype(np.float32), sigma=sigma)
241
+ smoothed_heatmap = (smoothed_heatmap - smoothed_heatmap.min()) / \
242
+ (smoothed_heatmap.max() - smoothed_heatmap.min())
243
+ colored_heatmap = (colormap(smoothed_heatmap) * 255).astype(np.uint8)
244
+
245
+ if colored_heatmap.shape[-1] == 4:
246
+ colored_heatmap = colored_heatmap[:, :, :3]
247
+
248
+ overlay = cv2.addWeighted(image, 1 - alpha, colored_heatmap, alpha, 0)
249
+ return Image.fromarray(overlay)
250
+
251
+ def save_visualization(selection_probs, image, output_dir):
252
+ os.makedirs(output_dir, exist_ok=True)
253
+ resize_transform = transforms.Resize(image.size[::-1])
254
+ for i, prob in enumerate(selection_probs):
255
+ prob = (prob - prob.min()) / (prob.max() - prob.min() + 1e-6)
256
+ prob = resize_transform(prob)
257
+ prob = prob.squeeze(0).detach().cpu().numpy()
258
+ # overlay the selection probability map on the original image
259
+ overlay = create_heatmap_overlay(np.array(image), prob)
260
+ overlay.save(os.path.join(output_dir, f"selection_prob_scale_{i}.png"))
261
+ image.save(os.path.join(output_dir, f"image.png"))
262
+
263
+ #################### End of helper functions ####################
264
+
265
+ selection_probs = outs.selection_probs
266
+ print([p.shape for p in selection_probs]) # [(1, 54, 54), (1, 108, 108), (1, 270, 270)]
267
+ save_visualization(selection_probs, image, "save_path/bottom_up_selection_probs")
268
+ ```
269
+ `selection_probs` contains the selection probability map for each scale. In this case, the feature map of each scale has shapes of 54x54, 108x108, and 270x270. The selection probability reflects how salient/important each patch is and patches with higher probability are selected first. You can visit the demo for more visualization.
270
+
271
+ ![Bottom-Up Selection Probabilities](assets/example_selection_maps/bottom_up_selection_prob.png)
272
+
273
+
274
+ ### 3. Encode High-Res Image with Top-Down Selection
275
+
276
+ PS3 can also select important high-res patches based on any text prompt.
277
+
278
+ First of all, load the text model and encode the text prompt.
279
+ ```python
280
+ from ps3 import PS3Tokenizer, PS3TextModel
281
+
282
+ tokenizer = PS3Tokenizer.from_pretrained("nvidia/PS3-4K-SigLIP2")
283
+ text_model = PS3TextModel.from_pretrained("nvidia/PS3-4K-SigLIP2")
284
+ text_model.cuda().eval()
285
+
286
+ text = ["A tall spire with a cross at the top of the building."]
287
+ text = tokenizer(text).cuda()
288
+ prompt = text_model(text).prompt
289
+ ```
290
+
291
+ Then PS3 can select important high-res patches based on the text prompt and encode those patches.
292
+ ```python
293
+ outs = vision_model(x, num_look_close=2, prompt=prompt)
294
+ features = outs.last_hidden_state
295
+ print(features.shape) # (1, 5849, 1152)
296
+ ```
297
+
298
+ You can visualize the top-down selection probabilities. Usually the regions related to the text prompt have higher selection probabilities.
299
+ ```python
300
+ selection_probs = outs.selection_probs
301
+ save_visualization(selection_probs, image, "save_path/top_down_selection_probs_1")
302
+ ```
303
+
304
+ ![Top-Down Selection Probabilities](assets/example_selection_maps/top_down_selection_prob_1.png)
305
+
306
+ You can change to another text prompt and see different selection probabilities.
307
+ ```python
308
+ text = ["A green rope on the green and red boat."]
309
+ text = tokenizer(text).cuda()
310
+ prompt = text_model(text).prompt
311
+ outs = vision_model(x, num_look_close=2, prompt=prompt)
312
+ selection_probs = outs.selection_probs
313
+ save_visualization(selection_probs, image, "save_path/top_down_selection_probs_2")
314
+ ```
315
+
316
+ ![Top-Down Selection Probabilities](assets/example_selection_maps/top_down_selection_prob_2.png)
317
+
318
+ ### 4. Format the Encoded Features into (Masked) Feature Maps
319
+
320
+ The features returned above are the concatenation of all the low-res and high-res features.
321
+
322
+ You can format the features into masked feature maps for each scale.
323
+ ```python
324
+ feature_maps = vision_model.vision_model.format_features_into_feature_maps(outs.last_hidden_state, outs.selection_maps)
325
+ print([x.shape for x in feature_maps]) # [(1, 1152, 27, 27), (1, 1152, 54, 54), (1, 1152, 108, 108), (1, 1152, 270, 270)]
326
+ ```
327
+ This will create a masked feature map `feature_maps` which is a list of feature maps (B * C * H * W) for each scale and each feature map contains the actual feature for the selected patches at that scaleand zero vector for the unselected patches.
328
+
329
+
330
+ ## Inference instructions
331
+
332
+ [Quick Start](#quick-start) gives some examples of how to use PS3 to encode an image. Below are more detailed explanations of the arguments of model inference.
333
+
334
+ ```python
335
+ class PS3VisionModel(PS3PreTrainedModel):
336
+ ...
337
+ def forward(
338
+ self,
339
+ pixel_values,
340
+ num_look_close,
341
+ num_token_look_close=None,
342
+ prompt=None,
343
+ gt_selection_maps=None,
344
+ smooth_selection_prob=False,
345
+ only_select_first_n_scale=None,
346
+ is_global_text=None,
347
+ pool_gt_token_only=False,
348
+ ):
349
+ ...
350
+ ```
351
+ `pixel_values`: the input images with shape (B, C, H, W).
352
+
353
+ `num_look_close`: how many times to run high-res selection and encoding. PS3 selects and processes 2560 patches each time. If set to `all` then it selects all the high-res patches. If set to `0` then PS3 only returns the low-res features. If set to a larger number than what it needs to encode all the high-res patches, then PS3 will clamp it to the max number needed.
354
+
355
+ `num_token_look_close`: (optinoal) how many high-res patches to select and process. Similar to `num_look_close` but `num_token_look_close` directly specifies the number of high-res tokens instead of number of running high-res encoding.
356
+
357
+ `prompt`: (optional) the prompt embedding used to select high-res patches. The prompt embedding can be embedding of some text, or some embedding output by an LLM (see the paper). The shape of prompt embedding is (B, C) where B is the batch size (same in `pixel_values`) and C is the embedding dimension (same as PS3 token embedding dimension). If `prompt=None`, then PS3 will select high-res patches based on visual saliency (bottom-up selection).
358
+
359
+ `gt_selection_maps`: (optional) the ground truth selection maps for the image. It should be a tensor of 0/1 values with shape (B, h, w). Regions with value 1 means they should be selected. When selecting high-res patches, PS3 will interpolate the `gt_selection_maps` to the same size as the feature map at each scale, prioritize selecting the tokens where the value is 1, and if there's still budget for selecting more tokens, it will select the rest based on the original selection probability.
360
+
361
+ `smooth_selection_prob`: (optional) smooth the selection probability map such that the selected patches won't be distributed too scarcely each time it runs high-res selection. It slightly improves the performance occasinoally when selecting all the patches but usually hurts when selecting parts of the patches.
362
+
363
+ `only_select_first_n_scale`: (optional) only select the first n high-res scales. For example, for PS3-4K model, if `only_select_first_n_scale=2`, then it only selects and processes scales of 756 and 1512, and ignores the scale of 3780.
364
+
365
+ `is_global_text`: (optional) only return the pooled low-res feautres. *It will only be used during pre-training.*
366
+
367
+ `pool_gt_token_only`: (optional) only pool the tokens inside the gt selection regions. *It will only be used during pre-training.*
368
+
369
+
370
+ ### Ethical Considerations:
371
+ NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse. Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
372
+
373
+
374
+ ## More Details
375
+ Please refer to the [PS3 codebase](https://github.com/NVlabs/PS3) for more details.
376
+
377
+
378
+ ## Citation
379
+
380
+ If you find this work useful in your research, please consider citing:
381
+
382
+ ```bibtex
383
+ @article{shi2025scaling,
384
+ title={Scaling Vision Pre-Training to 4K Resolution},
385
+ author={Shi, Baifeng and Li, Boyi and Cai, Han and Lu, Yao and Liu, Sifei and Pavone, Marco and Kautz, Jan and Han, Song and Darrell, Trevor and Molchanov, Pavlo and others},
386
+ journal={arXiv preprint arXiv:2503.19903},
387
+ year={2025}
388
+ }
389
+ ```
assets/example_selection_maps/bottom_up_selection_prob.png ADDED

Git LFS Details

  • SHA256: 497792f28e133233b02988881b2cd4600ebc9fab29fd74120697c8f527b2ed5a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.21 MB
assets/example_selection_maps/top_down_selection_prob_1.png ADDED

Git LFS Details

  • SHA256: d8f193d0a1a8065070b86cefa41dcefd27389cf88693a7b272547b8a98a2001e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.2 MB
assets/example_selection_maps/top_down_selection_prob_2.png ADDED

Git LFS Details

  • SHA256: 0e191dc01285341f6e353e147ed88f492a74cd282135a2e6bc3af6ee2741c54f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.18 MB
assets/ps3_siglip2_performance.png ADDED

Git LFS Details

  • SHA256: 35d7faf99e77b00b397a27e299a5da5cfaefa6b11bbcc2f0523daf5b9bd2b9ee
  • Pointer size: 131 Bytes
  • Size of remote file: 407 kB
assets/test_images/dock.jpg ADDED

Git LFS Details

  • SHA256: 2c35ed6357e5eed620bbcfda31315dead1e9ad8b6a4f324131705f61f489d99d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.71 MB
config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "runs/train/stage35_BS16/model/vision_tower",
3
+ "architectures": [
4
+ "PS3VisionModel"
5
+ ],
6
+ "class_token": null,
7
+ "drop": 0.0,
8
+ "drop_path": null,
9
+ "dynamic_img_size": true,
10
+ "final_norm": false,
11
+ "hidden_size": 1152,
12
+ "highres_selection_feature": true,
13
+ "highres_selection_module_depth": 3,
14
+ "highres_selection_module_hidden_dim": 512,
15
+ "highres_selection_module_kernel_size": 28,
16
+ "highres_selection_module_out_dim": 512,
17
+ "image_size": 1512,
18
+ "img_size": null,
19
+ "max_select_num": 2560,
20
+ "max_select_num_each_scale": null,
21
+ "min_select_num": 1,
22
+ "model_name": "vit_so400m_patch14_siglip_378",
23
+ "model_type": "ps3_vision_model",
24
+ "patch_drop": null,
25
+ "patch_size": 14,
26
+ "pool": "map",
27
+ "pretrained": false,
28
+ "radio": false,
29
+ "radio_adapter_mlp_hidden_dim": null,
30
+ "radio_adapter_mlp_input_dim": null,
31
+ "radio_adapter_mlp_num_inner": null,
32
+ "radio_adapter_mlp_output_dim": null,
33
+ "radio_adapter_mlp_version": null,
34
+ "s3_scales": [
35
+ 378,
36
+ 756,
37
+ 1512
38
+ ],
39
+ "select_based_on_layer": [
40
+ 0,
41
+ 9,
42
+ 18,
43
+ 26
44
+ ],
45
+ "separate_pos_emb": true,
46
+ "seperate_pos_emb": true,
47
+ "torch_dtype": "bfloat16",
48
+ "transformers_version": "4.46.0",
49
+ "vision_tower_name": "vit_so400m_patch14_siglip_378"
50
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a46eaa03eedf8b36eef5e8af97dd71672459b486e8f402374b63465023fda9b
3
+ size 971883368
preprocessor_config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 1512,
4
+ "width": 1512
5
+ },
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "PS3ImageProcessor",
12
+ "image_size": [
13
+ 1512,
14
+ 1512
15
+ ],
16
+ "image_std": [
17
+ 0.5,
18
+ 0.5,
19
+ 0.5
20
+ ],
21
+ "interpolation": "bicubic",
22
+ "mean": [
23
+ 0.5,
24
+ 0.5,
25
+ 0.5
26
+ ],
27
+ "resize_mode": "squash",
28
+ "size": {
29
+ "shortest_edge": 1512
30
+ },
31
+ "std": [
32
+ 0.5,
33
+ 0.5,
34
+ 0.5
35
+ ]
36
+ }