Feature Extraction
Transformers
Safetensors
medical
radiology
vision-language
chest-ct
3d-medical-imaging
glint
custom_code
Instructions to use Deepnoid/GLINT-CT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Deepnoid/GLINT-CT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Deepnoid/GLINT-CT", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Deepnoid/GLINT-CT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download vision_encoders.py from Deepnoid/GLINT-CT: direct link, hf CLI and curl.
- Browser
- Download file 962 Bytes
-
https://huggingface.co/Deepnoid/GLINT-CT/resolve/main/vision_encoders.py
- Command line
-
hf download hf://Deepnoid/GLINT-CT/vision_encoders.py
-
curl -L -o vision_encoders.py https://huggingface.co/Deepnoid/GLINT-CT/resolve/main/vision_encoders.py
962 Bytes
| import torch.nn as nn | |
| from transformers import Dinov2Config, Dinov2Model, DINOv3ViTConfig, DINOv3ViTModel, VJEPA2Config, VJEPA2Model | |
| def _hf_config(config_class, config): | |
| fields = config.to_dict() | |
| fields.pop("model_type", None) | |
| return config_class(**fields) | |
| def build_vision_encoder(config): | |
| if config.model_type == "dinov2": | |
| model = Dinov2Model(_hf_config(Dinov2Config, config)) | |
| nn.init.trunc_normal_(model.embeddings.mask_token, std=0.02) | |
| elif config.model_type == "dinov3_vit": | |
| model = DINOv3ViTModel(_hf_config(DINOv3ViTConfig, config)) | |
| nn.init.trunc_normal_(model.embeddings.mask_token, std=0.02) | |
| elif config.model_type == "vjepa2": | |
| model = VJEPA2Model(_hf_config(VJEPA2Config, config)) | |
| elif config.model_type == "vjepa2.1": | |
| from .vjepa21_encoder import VJEPA21Encoder | |
| model = VJEPA21Encoder(config) | |
| else: | |
| raise NotImplementedError() | |
| return model | |