GithubHelp home page GithubHelp logo

ku21fan / look_into_object_project Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 962 KB

unofficial PyTorch implementation of Look into object paper (CVPR2020).

Python 100.00%
object-recognition self-supervised-learning fine-grained-classification fine-grained-recognition fine-grained-visual-categorization

look_into_object_project's Introduction

Look-into-object-project. Blog link

This is unofficial pytorch implementation of Look-into-Object: Self-supervised Structure Modeling for Object Recognition CVPR2020).
This repository is created for the Visual Media class of UTokyo (as my class report).
Check the blog for details.

Getting started

This work was tested with PyTorch 1.2.0, torchvision 0.4.0, CUDA 10.0, python 3.6 and Ubuntu 16.04.
requirements: numpy, pillow, torchvision, tqdm, pretrainedmodels, pandas

pip install numpy pillow torchvision tqdm pretrainedmodels pandas 

Follow DCL repository's instruction to download and prepare datasets; CUB, STCAR(=CAR), and AIR.

Train

Train Look Into Object (LIO) module

CUDA_VISIBLE_DEVICES=0 python train.py --data CUB --mo LIO --exp_name LIO
CUDA_VISIBLE_DEVICES=1 python train.py --data STCAR --mo LIO --exp_name LIO
CUDA_VISIBLE_DEVICES=2 python train.py --data AIR --mo LIO --exp_name LIO

Train Object-Extent Learning (OEL) module

CUDA_VISIBLE_DEVICES=0 python train.py --data CUB --mo OEL --exp_name OEL
CUDA_VISIBLE_DEVICES=1 python train.py --data STCAR --mo OEL --exp_name OEL
CUDA_VISIBLE_DEVICES=2 python train.py --data AIR --mo OEL --exp_name OEL

Train Spatial Context Learning (SCL) module

CUDA_VISIBLE_DEVICES=0 python train.py --data CUB --mo SCL --exp_name SCL
CUDA_VISIBLE_DEVICES=1 python train.py --data STCAR --mo SCL --exp_name SCL
CUDA_VISIBLE_DEVICES=2 python train.py --data AIR --mo SCL --exp_name SCL

Train baseline (ResNet50)

CUDA_VISIBLE_DEVICES=0 python train.py --data CUB --exp_name baseline
CUDA_VISIBLE_DEVICES=1 python train.py --data STCAR --exp_name baseline
CUDA_VISIBLE_DEVICES=2 python train.py --data AIR --exp_name baseline

Test

CUDA_VISIBLE_DEVICES=0 python test.py --data CUB --save saved_models/[path-to-trained_model]
CUDA_VISIBLE_DEVICES=1 python test.py --data STCAR --save saved_models/[path-to-trained_model]
CUDA_VISIBLE_DEVICES=2 python test.py --data AIR --save saved_models/[path-to-trained_model]

Acknowledgement

We borrowed some codes from DCL repository.

look_into_object_project's People

Contributors

ku21fan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.