GithubHelp home page GithubHelp logo

leonardo-lyh / asl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenhaoxing/asl

0.0 0.0 0.0 353 KB

This repository is the code of the paper "Shaping Visual Representations with Attributes for Few-Shot Learning (IEEE SPL)".

License: MIT License

Python 100.00%

asl's Introduction

Shaping Visual Representations with Attributes for Few-Shot Learning (IEEE SPL)

This code implements the IEEE Signal Process. Lett. paper Shaping Visual Representations with Attributes for Few-Shot Learning (ASL).

Citation

If you find our work useful, please consider citing our work using the bibtex:

@ARTICLE{asl2022spl,  
        author={Chen, Haoxing and Li, Huaxiong and Li, Yaohui and Chen, Chunlin},  
        journal={IEEE Signal Processing Letters},   
        title={Shaping Visual Representations With Attributes for Few-Shot Recognition},   
        year={2022},  
        volume={29},  
        pages={1397-1401},  
        doi={10.1109/LSP.2022.3180934}
}

Prerequisites

  • Linux
  • Python 3.7
  • Pytorch 1.2
  • Torchvision 0.4
  • GPU + CUDA CuDNN

Datasets

You can download datasets automatically by adding --download when running the program. However, here we give steps to manually download datasets to prevent problems such as poor network connection: CUB:

  1. Create the dir ASL/datasets/cub;
  2. Download CUB_200_2011.tgz from here, and put the archive into ASL/datasets/cub;
  3. Running the program with --download.

SUN:

  1. Create the dir ASL/datasets/sun;
  2. Download the archive of images from here, and put the archive into ASL/datasets/sun;
  3. Download the archive of attributes from here, and put the archive into ASL/datasets/sun;
  4. Running the program with --download.

Few-shot Classification

Download data and run on multiple GPUs with special settings:

python train.py --train-data [train_data] --test-data [test_data] --backbone [backbone] --num-shots [num_shots] --batch-tasks [batch_tasks] --train-tasks [train_tasks] --semantic-type [semantic_type] --multi-gpu --download

Run on CUB dataset, ResNet-12 backbone, 1-shot, single GPU

python train.py --train-data cub --test-data cub --backbone resnet12 --num-shots 1 --batch-tasks 4 --train-tasks 60000 --semantic-type class_attributes

Note that batch tasks are set to 1. Larger batchsize may damage the learning of the visual-attribute generator.

Our code is based on TorchMeta.

Contacts

Please feel free to contact us if you have any problems.

Email: [email protected]

asl's People

Contributors

chenhaoxing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.