Sync with nvidia/C-RADIOv2-VLM-H-RC3
Browse filesFiles changed (4)
- README.md+3-1
- config.json+12-2
- model.safetensors+1-1
- vit_patch_generator.py+19
5 unmodified lines67891011121366 unmodified lines80818281838485865 unmodified lines
# Model Overview
[[**Github**](https://github.com/NVlabs/RADIO)] [[**CVPR 2025**](https://arxiv.org/abs/2412.07679)] [[**CVPR 2024**](https://arxiv.org/abs/2312.06709)]
## Description
This model performs visual feature extraction.66 unmodified linesfrom PIL import Imagefrom transformers import AutoModel, CLIPImageProcessor
hf_repo = "nvidia/C-RADIOv2-H"hf_repo = "nvidia/C-RADIOv2-VLM-H-RC3"
image_processor = CLIPImageProcessor.from_pretrained(hf_repo)model = AutoModel.from_pretrained(hf_repo, trust_remote_code=True)15 unmodified lines16171819192021228 unmodified lines3132333435363727 unmodified lines656667676869707198 unmodified lines17017117217317417517617717817918018118218318415 unmodified lines "cache_dir": null, "channels_last": false, "checkpoint_hist": 10, "chk_keep_forever": 50, "chk_keep_forever": 100, "class_map": "", "clip_grad": null, "clip_mode": "norm",8 unmodified lines "crop_pct": null, "cutmix": 0.0, "cutmix_minmax": null, "damp": null, "dataset_download": false, "debug_full_knn": false, "decay_epochs": 90,27 unmodified lines "force_new_wandb_id": false, "force_spectral_reparam": true, "freeze_bn": false, "fsdp": true, "fsdp": false, "full_equivariance": false, "fuser": "", "gp": null,98 unmodified lines "name": "siglip2-g", "type": "siglip2", "use_summary": true }, { "fd_normalize": false, "feature_distillation": true, "input_size": 384, "model": "siglip2-g-384", "name": "siglip2-g-dirty", "type": "siglip2", "use_summary": false } ], "torchcompile": null,1223version https://git-lfs.github.com/spec/v1oid sha256:e00385571b42a060742e3dd14ea7ac17f099968482115dc49a66aac34d1aa0a2oid sha256:96ff3bfec4f732d68a0c38c41a49de043abd2503df24481526ea87d26dd6a4f5size 2606616120118 unmodified lines119120121122123124125126127128156 unmodified lines285286287288289290291292293294295296297298299300301302118 unmodified lines 'pos_embed', ]
def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs): if self.abs_pos: self._load_embed(state_dict[f'{prefix}pos_embed'], self.pos_embed)
def _load_embed(self, src_embed: torch.Tensor, targ_embed: nn.Parameter): if src_embed.shape != targ_embed.shape: src_size = int(math.sqrt(src_embed.shape[1]))156 unmodified lines **factory ) self.patch_size = patch_size
def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs): if self.bias is not None: self.bias.data.copy_(state_dict[f'{prefix}bias'])
chk_weight = state_dict[f'{prefix}weight'] if chk_weight.shape != self.weight.shape: src_patch_size = int(math.sqrt(chk_weight.shape[1] // 3))
assert (src_patch_size ** 2) * 3 == chk_weight.shape[1], 'Unable to interpolate non-square patch size'
chk_weight = rearrange(chk_weight, 'b (c h w) -> b c h w', c=3, h=src_patch_size, w=src_patch_size) chk_weight = F.interpolate(chk_weight, size=(self.patch_size, self.patch_size), mode='bicubic', align_corners=True, antialias=False) chk_weight = rearrange(chk_weight, 'b c h w -> b (c h w)') self.weight.data.copy_(chk_weight)README.md+3-1
config.json+12-2
model.safetensors+1-1
vit_patch_generator.py+19