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/dermlip-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]=3219636f48b0 |
best_stageB.pt | 2 GB | sha256[:12]=69bded2dcad1 |
final_captioner_gpt2-medium_VisionTransformer.json | 849 B | sha256[:12]=e157402c9fe2 |
final_captioner_gpt2-medium_VisionTransformer.pt | 2 GB | sha256[:12]=536ae07811c9 |
loss_dermlip_vitb16.png | 110 KB | sha256[:12]=a04b1e5832d9 |
gpt2-medium)hf-hub:redlessone/DermLIP_ViT-B-16Describe the skin lesion concisely (morphology, color, scale, border, location) in one sentence.Conclude with the most likely diagnosis (1–3 words).dermlipmoxeeeem/dermlip-gpt2-captioner