Official Pytorch Implementation of LPFS.
Create a conda environment and install dependencies:
git clone https://github.com/YvoGao/LPFS
cd LPFS
conda create -n LPFS python=3.8
conda activate LPFS
pip install -r requirements.txt
Follow DATASET.md to install ImageNet and other 10 datasets referring to CoOp.
- Download Pretraining Model to
./model/clip
_MODELS = {
"RN50": "https://openaipublic.azureedge.net/clip/models/afeb0e10f9e5a86da6080e35cf09123aca3b358a0c3e3b6c78a7b63bc04b6762/RN50.pt",
"RN101": "https://openaipublic.azureedge.net/clip/models/8fa8567bab74a42d41c5915025a8e4538c3bdbe8804a470a72f30b0d94fab599/RN101.pt",
"RN50x4": "https://openaipublic.azureedge.net/clip/models/7e526bd135e493cef0776de27d5f42653e6b4c8bf9e0f653bb11773263205fdd/RN50x4.pt",
"RN50x16": "https://openaipublic.azureedge.net/clip/models/52378b407f34354e150460fe41077663dd5b39c54cd0bfd2b27167a4a06ec9aa/RN50x16.pt",
"ViT-B/32": "https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt",
"ViT-B/16": "https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt",
}
-
Config
DATA_ROOTintrain.py. -
Config
MODEL_CACHE_DIRintrain.py. -
Set
LOG_ROOTintrain.py.
Use the following Linux command to simply reproduce the main results of our paper:
bash run.shThis repo is build upon previous amazing repos include CLIP, TIMO, CuPL and LDC. Thanks for their contributions to the field.
@inproceedings{Gao_2026_ICME,
title={Joint Logits Purification and Feature Supplement for CLIP-based Few-shot Learning},
author={Gao, Yunlong and Wang, Jun and Yang, Wentao and Liang, Wenxin and Zong, Linlin and Liu, Xinyue},
journal={ICME},
year={2026}
}

