Views
No views yet
gpt2-medium).
Trained in two stages: Stage A (META) for generalization and Stage B (SkinCAP) for style/terminology.Minimal example usesinference_min.pyincluded in this repo.
Requires:pip install torch transformers open_clip_torch pillow huggingface_hub
1from huggingface_hub import snapshot_download
2from inference_min import load_model, generate
3
4# 1) download repo snapshot
5repo_dir = snapshot_download("moxeeeem/pubmedclip-gpt2-captioner", allow_patterns=["*.pt","*.json","inference_min.py"])
6
7# 2) load model from saved config/weights
8model = load_model(repo_dir) # builds CLIP backend + GPT-2 + prefix projector
9
10# 3) run generation
11img_paths = ["/path/to/derma_image.jpg"] # local test images
12caps = generate(model, img_paths, prompt="Describe the skin lesion concisely (morphology, color, scale, border, location) in one sentence.Conclude with the most likely diagnosis (1\u20133 words).")
13for c in caps:
14 print(c)| File | Size | Check |
|---|---|---|
best_stageA.pt | 2 GB | sha256[:12]=4c3f773c92f9 |
best_stageB.pt | 2 GB | sha256[:12]=2b1b7e6aaa8f |
final_captioner_gpt2-medium_TimmModel.json | 899 B | sha256[:12]=40f3fb250eab |
final_captioner_gpt2-medium_TimmModel.pt | 2 GB | sha256[:12]=799a4d1b831d |
loss_biomedclip_pubmedbert.png | 112 KB | sha256[:12]=92c3b8dfdf7f |
gpt2-medium)hf-hub:microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224Describe the skin lesion concisely (morphology, color, scale, border, location) in one sentence.Conclude with the most likely diagnosis (1–3 words).pubmedclipmoxeeeem/pubmedclip-gpt2-captioner