Views
No views yet
ViT-L-14 architecture.
The model was presented in the paper MedPMC: A Systematic Framework for Scaling High-Fidelity Medical Multimodal Data for Foundation Models.ViT-L-14.tokenizer = open_clip.get_tokenizer("ViT-L-14")open_clip_model.safetensors: OpenCLIP-format model checkpointinference_example.py: example code for image-text similarityrequirements.txt: minimal dependencies1import torch
2import open_clip
3from huggingface_hub import hf_hub_download
4from PIL import Image
5
6model_name = "ViT-L-14"
7device = "cuda" if torch.cuda.is_available() else "cpu"
8
9repo_id = "Yale-BIDS-Chen/medpmc-clip-l-14_jun24_v1"
10
11ckpt_path = hf_hub_download(
12 repo_id=repo_id,
13 filename="open_clip_model.safetensors",
14)
15
16model, _, preprocess = open_clip.create_model_and_transforms(
17 model_name,
18 pretrained=ckpt_path,
19 device=device,
20)
21
22model.eval()
23tokenizer = open_clip.get_tokenizer(model_name)
24
25image = preprocess(
26 Image.open("/path/to/example.jpg").convert("RGB")
27).unsqueeze(0).to(device)
28
29text = tokenizer([
30 "fundus photograph",
31 "chest radiograph",
32 "histopathology image",
33]).to(device)
34
35with torch.no_grad():
36 image_features = model.encode_image(image)
37 text_features = model.encode_text(text)
38
39 image_features /= image_features.norm(dim=-1, keepdim=True)
40 text_features /= text_features.norm(dim=-1, keepdim=True)
41
42 similarity = image_features @ text_features.T
43
44print(similarity)1@article{kim2026medpmc,
2 title={MedPMC: A Systematic Framework for Scaling High-Fidelity Medical Multimodal Data for Foundation Models},
3 author={Kim, Hyunjae and Kim, Dain and Xiao, Pan and Applebaum, Serina S and Chung, Younjoon and Ai, Xuguang and Yin, Yu and Jiang, Roy and Du, Yuexi and Wei, Yawen and others},
4 journal={arXiv preprint arXiv:2607.07673},
5 year={2026}
6}hyunjae.kim@yale.edu.