Giter Site home page Giter Site logo

tayfunyugruk / grcnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jianf-wang/grcnn

0.0 0.0 0.0 12.48 MB

This is an implementation of the paper "Convolutional Neural Networks with Gated Recurrent Connections".

License: MIT License

Shell 0.66% Python 48.69% Makefile 0.01% Batchfile 0.01% Jupyter Notebook 50.60% Dockerfile 0.03%

grcnn's Introduction

GRCNN

A Pytorch implementation of T-PAMI 2021 paper "Convolutional Neural Networks with Gated Recurrent Connections", which is an extended journal version of the previous work "Gated Recurrent Convolution Neural Network for OCR" (https://github.com/Jianf-Wang/GRCNN-for-OCR) presented in NeurIPS 2017. Extensive experiments are presented in this journal version.

Build

This GRCNN implementation is built upon the PyTorch. The requirements are:

  1. PyTorch 1.7.0
  2. CUDA 10.1

Training on Cifar

To simply train on cifar-10, please run with the following command:

GRCNN-56:

python train_cifar.py --gpu-id 0,1 -a grcnn56 

For other network architectures, please set "-a".

If you want to use the weight sharing setting, you can set "--weight-sharing" to "True".

To train on the cifar-100, you can add "--dataset cifar100" to the command.

Training on ImageNet

To train GRCNN or SK-GRCNN on ImageNet, please run with the following command:

GRCNN-55:

python imagenet_train.py \
  --epochs 100 \
  --dist-url 'tcp://localhost:10010' --multiprocessing-distributed --world-size 1 --rank 0 \
  --arch grcnn55 \

SK-GRCNN-55:

python imagenet_train.py \
  --epochs 120 \
  --dist-url 'tcp://localhost:10010' --multiprocessing-distributed --world-size 1 --rank 0 \
  --arch skgrcnn55 \
  --cos \

As for GRCNN-109 and SK-GRCNN-109, please set "--arch".

Pretrained Model

The ImageNet pretrained models are released. Note that we also release the weight sharing version of GRCNN-55 and GRCNN-109. The weight sharing version GRCNNs have less parameters and achieve competitive results on ImageNet when compared with other light weight models.

name param top-1 acc. model (Google Drive) model (Baidu Disk)
GRCNN-55 24.9M 77.02 download download (code: vdb1)
SK-GRCNN-55 27.4M 79.38 download download (code: temi)
GRCNN-109 45.1M 78.20 download download (code: sxcd)
SK-GRCNN-109 50.0M 80.01 download download (code: 93tr)
GRCNN-55 (weight sharing) *12.0M* 75.49 download download (code: s11g)
GRCNN-109 (weight sharing) *12.1M* 76.00 download download (code: 4eiv)

To simply use the pretrained models, run following commands:

import torch
import models.imagenet.GRCNN as grcnn
model = grcnn.grcnn55()
model.load_state_dict(torch.load('checkpoint_params_grcnn55.pt'))

Detection

The experiments of object detection in the paper are conducted based on the repository of the original papers. But in order to widely evaluate GRCNN on different object detection methods, we integrated GRCNN into a well-known object detetion toolbox: MMDetection.

For the installation, please go to the the direction "./mmdetection" and use the following command:

 conda env create -f GRCNN_Detect.yaml 
 conda activate GRCNN_Detect
 pip install -v -e .

After the installation, a simple command to train a GRCNN109 based mask_rcnn:

./tools/dist_train.sh configs/GRCNN/mask_rcnn_grcnn109_fpn_2x_coco.py 8

More information about configuration files and GRCNN can be found in the directory "./mmdetection/configs/GRCNN" and "./mmdetection/mmdet/models/backbones/GRCNN.py"

Citation

@Article{jianfeng2021grcnn,
  author  = {Jianfeng Wang and Xiaolin Hu},
  title   = {Convolutional Neural Networks with Gated Recurrent Connections},
  journal = {TPAMI},
  year    = {2021},
}

grcnn's People

Contributors

jianf-wang 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.