Giter Club home page Giter Club logo

life's Introduction

LIFE

Overview

This repo is an official implementation for the Local InFormation Extractor (LIFE) Module framework.

LIFE module
LIFE Module Data Flow

Installation

Requirements

  • Python >= 3.6
  • PyTorch >= 1.8 and torchvision
  • timm:
    • pip install timm

Prepare data

Download and extract ImageNet100 train and val images from https://www.kaggle.com/datasets/ambityga/imagenet100.

The directory structure is the standard layout for the torchvision datasets.ImageFolder, and the training and validation data is expected to be in the train/ folder and val/ folder respectively:

/path/to/ImageNet100/
  train/
    class1/
      img1.jpeg
    class2/
      img2.jpeg
  val/
    class1/
      img3.jpeg
    class/2
      img4.jpeg

Usage

Training

# Running training procedure with specific GPU number
./tools/run_dist_launch.sh <GPU_NUM> python main.py [optional arguments]

Example command for training DeiT Small with LIFE module with batch size of 512 on 2 GPUs

./tools/run_dist_launch.sh 2 python main.py --data-path /path/to/ImageNet100 --data-set IMNET100 --model deit_small_patch16_224_ms --batch-size 256 --input-size 224 --epochs 300 --output_dir /path/to/output/folder

Please refer to main.py for more optional arguments

Inference

# Running inference procedure with specific GPU number and model path
./tools/run_dist_launch.sh <GPU_NUM> <path_to_config> --eval --resume <model_path> [optional arguments]

Please refer to main.py for more optional arguments

Image Classification Results

Classification Results

Object Detection Results on the VOC dataset

Detection Results

Semantic Segmentation Results on the CityScapes dataset

Segmentation Results

Citation

Please cite the paper in your publications if it helps your research.

@article{akkaya2024enhancing,
  title={Enhancing performance of vision transformers on small datasets through local inductive bias incorporation},
  author={Akkaya, Ibrahim Batuhan and Kathiresan, Senthilkumar S and Arani, Elahe and Zonooz, Bahram},
  journal={Pattern Recognition},
  pages={110510},
  year={2024},
  publisher={Elsevier}
}

Acknowledgements

This code is heavily borrowed from VTPack.

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.