Code Monkey home page Code Monkey logo

as-mlp's Introduction

AS-MLP architecture for Image Classification

Model Zoo

Image Classification on ImageNet-1K

Network Resolution Top-1 (%) Params FLOPs Throughput (image/s) model
AS-MLP-T 224x224 81.3 28M 4.4G 1047 onedrive
AS-MLP-S 224x224 83.1 50M 8.5G 619 onedrive
AS-MLP-B 224x224 83.3 88M 15.2G 455 onedrive

Usage

Install

  • Clone this repo:
git clone https://github.com/svip-lab/AS-MLP
cd AS-MLP
  • Create a conda virtual environment and activate it:
conda create -n asmlp python=3.7 -y
conda activate asmlp
conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
  • Install timm==0.3.2:
pip install timm==0.3.2
  • Install cupy-cuda101:
pip install cupy-cuda101
  • Install Apex:
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
  • Install other requirements:
pip install opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8

Evaluation

To evaluate a pre-trained AS-MLP on ImageNet val, run:

bash train_scripts/test.sh

Training from scratch

To train a AS-MLP on ImageNet from scratch, run:

bash train_scripts/train.sh

You can easily reproduce our results. Enjoy!

Throughput

To measure the throughput, run:

bash train_scripts/get_throughput.sh

Citation

If this project is helpful for you, you can cite our paper:

@article{Lian_2021_ASMLP,
  author = {Lian, Dongze and Yu, Zehao and Sun, Xing and Gao, Shenghua},
  title = {AS-MLP: An Axial Shifted MLP Architecture for Vision},
  journal={arXiv preprint arXiv:2107.08391},
  year = {2021}
}

Acknowledgement

The code is built upon Swin-Transformer

as-mlp's People

Contributors

developer0hye avatar dongzelian avatar niujinshuchong 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.