{"id":13738165,"url":"https://github.com/WenbinLee/CovaMNet","last_synced_at":"2025-05-08T16:32:35.351Z","repository":{"id":165585078,"uuid":"156577069","full_name":"WenbinLee/CovaMNet","owner":"WenbinLee","description":"The Pytorch code of \"Distribution Consistency based Covariance Metric Networks for Few-shot Learning\", AAAI 2019.","archived":false,"fork":false,"pushed_at":"2020-10-08T14:05:03.000Z","size":1974,"stargazers_count":57,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T07:33:52.664Z","etag":null,"topics":["few-shot-learning","second-order"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WenbinLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-11-07T16:36:50.000Z","updated_at":"2024-11-13T04:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"b143d358-13b5-4804-9672-5066dbead8c0","html_url":"https://github.com/WenbinLee/CovaMNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenbinLee%2FCovaMNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenbinLee%2FCovaMNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenbinLee%2FCovaMNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenbinLee%2FCovaMNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WenbinLee","download_url":"https://codeload.github.com/WenbinLee/CovaMNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253105340,"owners_count":21855006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["few-shot-learning","second-order"],"created_at":"2024-08-03T03:02:12.947Z","updated_at":"2025-05-08T16:32:34.844Z","avatar_url":"https://github.com/WenbinLee.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# CovaMNet in PyTorch\n\nWe provide a PyTorch implementation of CovaMNet for few-shot learning. The code was written by [Wenbin Li](https://github.com/WenbinLee)\u003ca href=\"https://cs.nju.edu.cn/liwenbin/\"\u003e [Homepage]\u003c/a\u003e.\u003cbr\u003e\n\nIf you use this code for your research, please cite: \n\n[Distribution Consistency based Covariance Metric Networks for Few-shot Learning](https://cs.nju.edu.cn/rl/people/liwb/AAAI19.pdf).\u003cbr\u003e \n[Wenbin Li](https://cs.nju.edu.cn/liwenbin/), Jinglin Xu, Jing Huo, Lei Wang, Yang Gao and Jiebo Luo. In AAAI 2019.\u003cbr\u003e \n\u003cimg src='imgs/CovaMNet.bmp' width=500/\u003e\n\n\n## Prerequisites\n- Linux\n- Python 3\n- Pytorch 0.4\n- GPU + CUDA CuDNN\n\n## Getting Started\n### Installation\n\n- Clone this repo:\n```bash\ngit clone https://github.com/WenbinLee/CovaMNet\ncd CovaMNet\n```\n\n- Install [PyTorch](http://pytorch.org) 0.4 and other dependencies (e.g., torchvision).\n\n### Datasets\n- [miniImageNet](https://drive.google.com/file/d/1fUBrpv8iutYwdL4xE1rX_R9ef6tyncX9/view). \n- [StanfordDog](http://vision.stanford.edu/aditya86/ImageNetDogs/).\n- [StanfordCar](https://ai.stanford.edu/~jkrause/cars/car_dataset.html).\n- [CUB-200](http://www.vision.caltech.edu/visipedia/CUB-200.html). \u003cbr\u003e\nThanks [Victor Garcia](https://github.com/vgsatorras/few-shot-gnn) for providing the miniImageNet dataset. In our paper, we just used the CUB-200 dataset. In fact, there is a newer revision of this dataset with more images, see [Caltech-UCSD Birds-200-2011](http://www.vision.caltech.edu/visipedia/CUB-200-2011.html). Note, if you use these datasets, please cite the corresponding papers. \n\n\n###  miniImageNet Few-shot Classification\n- Train a 5-way 1-shot model:\n```bash\npython CovaMNet_Train_5way1shot.py --dataset_dir ./datasets/miniImageNet --data_name miniImageNet\n```\n- Test the model (specify the dataset_dir and data_name first):\n```bash\npython CovaMNet_Test_5way1shot.py --resume ./results/CovaMNet_miniImageNet_Conv64_5_Way_1_Shot/model_best.pth.tar\n```\n- The results on the miniImageNet dataset: \n\u003cimg src='imgs/results_miniImageNet.bmp' align=\"center\" width=800\u003e\n\n\n###  Fine-grained Few-shot Classification\n- Data prepocessing (e.g., StanfordDog)\n - Specify the path of the dataset and the saving path.\n - Run the preprocessing script.\n```bash\n#!./dataset/StanfordDog/StanfordDog_prepare_csv.py\npython ./dataset/StanfordDog/StanfordDog_prepare_csv.py\n```\n- Train a 5-way 1-shot model:\n```bash\npython CovaMNet_Train_5way1shot.py --dataset_dir ./datasets/StanfordDog --data_name StanfordDog\n```\n- Test the model (specify the dataset_dir and data_name first):\n```bash\npython CovaMNet_Test_5way1shot.py --resume ./results/CovaMNet_StanfordDog_Conv64_5_Way_1_Shot/model_best.pth.tar\n```\n- The results on the fine-grained datasets: \n\u003cimg src='imgs/result_finegrained.bmp' align=\"center\" width=800\u003e\n\n\n\n## Citation\nIf you use this code for your research, please cite our paper.\n```\n@inproceedings{li2019CovaMNet,\n  title={Distribution Consistency based Covariance Metric Networks for Few-shot Learning},\n  author={Li, Wenbin and Xu, Jinglin and Huo, Jing and Wang, Lei and Gao Yang and Luo, Jiebo},\n  booktitle={AAAI},\n  year={2019}\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenbinLee%2FCovaMNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWenbinLee%2FCovaMNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenbinLee%2FCovaMNet/lists"}