{"id":13737587,"url":"https://github.com/shiyuanh/TANE","last_synced_at":"2025-05-08T14:33:05.602Z","repository":{"id":46092107,"uuid":"473328540","full_name":"shiyuanh/TANE","owner":"shiyuanh","description":"Code Repository for \"Task-Adaptive Negative Envision for Few-Shot Open-Set Recognition\"","archived":false,"fork":false,"pushed_at":"2022-08-02T14:34:15.000Z","size":48,"stargazers_count":26,"open_issues_count":4,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-15T06:32:07.538Z","etag":null,"topics":["computer-vision","cvpr2022","few-shot","few-shot-open-set-recognition","meta-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiyuanh.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}},"created_at":"2022-03-23T19:22:25.000Z","updated_at":"2024-11-04T09:15:37.000Z","dependencies_parsed_at":"2022-07-19T02:47:15.301Z","dependency_job_id":null,"html_url":"https://github.com/shiyuanh/TANE","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/shiyuanh%2FTANE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiyuanh%2FTANE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiyuanh%2FTANE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiyuanh%2FTANE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiyuanh","download_url":"https://codeload.github.com/shiyuanh/TANE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253085772,"owners_count":21851697,"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":["computer-vision","cvpr2022","few-shot","few-shot-open-set-recognition","meta-learning"],"created_at":"2024-08-03T03:01:54.187Z","updated_at":"2025-05-08T14:33:05.199Z","avatar_url":"https://github.com/shiyuanh.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Task-Adaptive Negative Envision for Few-Shot Open-Set Recognition\nThis is the code repository for [\"Task-Adaptive Negative Envision for Few-Shot Open-Set Recognition\"](https://openaccess.thecvf.com/content/CVPR2022/html/Huang_Task-Adaptive_Negative_Envision_for_Few-Shot_Open-Set_Recognition_CVPR_2022_paper.html) (accepted by CVPR 2022).\n \n\n## Installation\nThis repo is tested with Python 3.6, Pytorch 1.8, CUDA 10.1. More recent versions of Python and Pytorch with compatible CUDA versions should also support the code. \n\n\n## Data Preparation\nMiniImageNet image data are provided by [RFS](https://github.com/WangYueFt/rfs), available at [DropBox](https://www.dropbox.com/sh/6yd1ygtyc3yd981/AABVeEqzC08YQv4UZk7lNHvya?dl=0). We also provide the word embeddings for the class names [here](https://drive.google.com/file/d/1CpF3M_qySCBhIWOSURIT_LpA1B61tsFb/view?usp=sharing). For TieredImageNet, we use the image data and word embeddings provided by [AW3](https://github.com/ServiceNow/am3), available at [GoogleDrive](https://drive.google.com/file/d/1Letu5U_kAjQfqJjNPWS_rdjJ7Fd46LbX/view). Download and put them under your \u003c*data_dir*\u003e.\n\n\n## Pre-trained models\nWe provide the pre-trained models for TieredImageNet and MiniImageNet, which can be downloaded [here](https://drive.google.com/drive/folders/1mj8j5ZChRFLcYMBWEsBBhst8uQTOz_WJ?usp=sharing). Save the pre-trained model to \u003c*pretrained_model_path*\u003e.\n\n## Training \nAn example of training command for 5-way 1-shot FSOR:\n```\npython train.py --dataset \u003cdataset\u003e --logroot \u003clog_root\u003e  --data_root \u003cdata_dir\u003e \\ \n                --n_ways 5  --n_shots 1 \\\n                --pretrained_model_path \u003cpretrained_model_path\u003e \\\n                --featype OpenMeta \\\n                --learning_rate 0.03 \\\n                --tunefeat 0.0001 \\\n                --tune_part 4 \\\n                --cosine \\\n                --base_seman_calib 1 \\\n                --train_weight_base 1 \\\n                --neg_gen_type semang                 \n```\n\n## Testing\nAn example of testing command for 5-way 1-shot FSOR:\n```\npython test.py --dataset \u003cdataset\u003e  --data_root \u003cdata_dir\u003e \\\n               --n_ways 5  --n_shots 1 \\\n               --pretrained_model_path \u003cpretrained_model_path\u003e \\\n               --featype OpenMeta \\\n               --test_model_path \u003ctest_model_path\u003e \\\n               --n_test_runs 1000 \\\n               --seed \u003cseed\u003e \n```\n\n## Pre-training\nWe also provide the code for the pre-training stage under `pretrain` folder. An example of running command for pre-training on miniImageNet:\n```\npython batch_process.py --featype EntropyRot --learning_rate 0.05\n```\n\n## Citation\nIf you find this repo useful for your research, please consider citing the paper:\n```\n@InProceedings{Huang_2022_CVPR,\n    author    = {Huang, Shiyuan and Ma, Jiawei and Han, Guangxing and Chang, Shih-Fu},\n    title     = {Task-Adaptive Negative Envision for Few-Shot Open-Set Recognition},\n    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    month     = {June},\n    year      = {2022},\n    pages     = {7171-7180}\n}\n```\n\n\n## Acknowledgement\nOur code and data are based upon [RFS](https://github.com/WangYueFt/rfs) and [AW3](https://github.com/ServiceNow/am3). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiyuanh%2FTANE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiyuanh%2FTANE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiyuanh%2FTANE/lists"}