We provide a PyTorch implementation of CovaMNet for few-shot learning. The code was written by Wenbin Li [Homepage].
If you use this code for your research, please cite:
Distribution Consistency based Covariance Metric Networks for Few-shot Learning.
Wenbin Li, Jinglin Xu, Jing Huo, Lei Wang, Yang Gao and Jiebo Luo. In AAAI 2019.
Clone this repo:
git clone https://github.com/WenbinLee/CovaMNet
cd CovaMNet
Install PyTorch 0.4 and other dependencies (e.g., torchvision).
python CovaMNet_Train_5way1shot.py --dataset_dir ./datasets/miniImageNet --data_name miniImageNet
python CovaMNet_Test_5way1shot.py --resume ./results/CovaMNet_miniImageNet_Conv64_5_Way_1_Shot/model_best.pth.tar
#!./dataset/StanfordDog/StanfordDog_prepare_csv.py
python ./dataset/StanfordDog/StanfordDog_prepare_csv.py
python CovaMNet_Train_5way1shot.py --dataset_dir ./datasets/StanfordDog --data_name StanfordDog
python CovaMNet_Test_5way1shot.py --resume ./results/CovaMNet_StanfordDog_Conv64_5_Way_1_Shot/model_best.pth.tar
If you use this code for your research, please cite our paper.
@inproceedings{li2019CovaMNet,
title={Distribution Consistency based Covariance Metric Networks for Few-shot Learning},
author={Li, Wenbin and Xu, Jinglin and Huo, Jing and Wang, Lei and Gao Yang and Luo, Jiebo},
booktitle={AAAI},
year={2019}
}