Skip to content
 
 

Repository files navigation

Make few-shot learning easy.

This repository is a research extension of the original LibFewShot project. It preserves the upstream MIT license and attribution while adding the following integrations:

  • LDP-Net
  • LDC, using the authors' external CLIP-LDC package

Datasets, pretrained weights, checkpoints, and experiment outputs are local artifacts and are intentionally excluded from Git.

LibFewShot: A Comprehensive Library for Few-shot Learning. Wenbin Li, Ziyi Wang, Xuesong Yang, Chuanqi Dong, Pinzhuo Tian, Tiexin Qin, Jing Huo, Yinghuan Shi, Lei Wang, Yang Gao, Jiebo Luo. In TPAMI 2023.

Supported Methods

Non-episodic methods (a.k.a Fine-tuning based methods)

Meta-learning based methods

Metric-learning based methods

Quick Installation

Please refer to install.md(安装) for installation.

Complete tutorials can be found at document(中文文档).

Command-line Usage

All standard entry points are config-driven; no local experiment path is embedded in the scripts.

Train a model:

python run_trainer.py --config ./config/proto.yaml

Evaluate a result directory (the saved config.yaml is loaded automatically):

python run_test.py --result-path ./results/your-experiment

Resume training:

python run_trainer_resume.py --result-path ./results/your-experiment

Dataset paths and other common settings can still be overridden on the command line. For example: --data_root ./data/miniImageNet--ravi --n_gpu 1. LDC uses its dedicated run_ldc.py entry point; see the LDC reproduction guide.

Reproduction

We provide some validated configs in reproduce, please refer to ./reproduce/<Method_Name>/README.md for further infomations. The meanings of the symbols are as follows:

📖 The accuracies reproted by the papers.

💻 The accuracies reproted by ourselves.

⬇️ Hyperlinks to download the checkpoints folder. (Containing config.yaml, model_best.pth and the train/test log)

📋 Hyperlinks to the config file.

You can also find these checkpoints at model_zoo.

Datasets

Caltech-UCSD Birds-200-2011, Standford Cars, Standford Dogs, miniImageNet, tieredImageNet and WebCaricature are available at Google Drive and 百度网盘(提取码:yr1w).

Contributing

Please feel free to contribute any kind of functions or enhancements, where the coding style follows PEP 8. Please kindly refer to contributing.md(贡献代码) for the contributing guidelines.

License

This project is licensed under the MIT License. See LICENSE for more details.

Acknowledgement

LibFewShot is an open source project designed to help few-shot learning researchers quickly understand the classic methods and code structures. We welcome other contributors to use this framework to implement their own or other impressive methods and add them to LibFewShot. This library can only be used for academic research. We welcome any feedback during using LibFewShot and will try our best to continually improve the library.

Citation

If you use this code for your research, please cite our paper.

@article{li2021LibFewShot,
title = {LibFewShot: A Comprehensive Library for Few-Shot Learning},
author={Li, Wenbin and Wang, Ziyi and Yang, Xuesong and Dong, Chuanqi and Tian, Pinzhuo and Qin, Tiexin and Huo Jing and Shi, Yinghuan and Wang, Lei and Gao, Yang and Luo, Jiebo},
journal = {IEEE Transactions on Pattern Analysis &amp; Machine Intelligence},
year = {2023},
number = {01},
issn = {1939-3539},
pages = {1-18}
}

About

[TPAMI 2023] LibFewShot: A Comprehensive Library for Few-shot Learning.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages