Giter Site home page Giter Site logo

restr's Introduction

ReSTR: Convolution-Free Referring Image Segmentation Using Transformers

plot

This repository contains the official source code for our paper:
ReSTR: Convolution-Free Referring Image Segmentation Using Transformers
Namyup Kim1, Dongwon Kim1, Cuiling Lan2, Wenjun Zeng2, and Suha Kwak1
1POSTECH CSE, 2Microsoft Research Asia
CVPR, 2022.

Environment setup

  • Python 3.7.13
  • PyTorch 1.13.1+cu117

Instructions:

conda env create -f restr.yaml
conda activate restr

Data Setup

1. Setting

  • Download or use symlink, such that the MS COCO images are under data/coco/images/train2014/
  • Download or use symlink, such that the ReferItGame data are under data/referit/images and data/referit/mask
  • Download, git clone, or use symlink, such that refer is under external. Then strictly follow the Setup and Download section of its README. Also, put the refer folder in PYTHONPATH as export PYTHONPATH=${PYTHONPATH}:/my/restr/path/external/refer
  • Download, git clone, or use symlink, such that the MS COCO API is under external (i.e. external/coco/PythonAPI/pycocotools)

2. Data preparation

python build_batches.py -d Gref -t train --img-size 480
python build_batches.py -d Gref -t val --img-size 480
python build_batches.py -d unc -t train --img-size 480
python build_batches.py -d unc -t val --img-size 480
python build_batches.py -d unc -t testA --img-size 480
python build_batches.py -d unc -t testB --img-size 480
python build_batches.py -d unc+ -t train --img-size 480
python build_batches.py -d unc+ -t val --img-size 480
python build_batches.py -d unc+ -t testA --img-size 480
python build_batches.py -d unc+ -t testB --img-size 480
python build_batches.py -d referit -t trainval --img-size 480
python build_batches.py -d referit -t test --img-size 480

3. Directory Structure After Sutup and Data Preparation

├─ ./data              
      ├─ mscoco   
      │   ├─ Gref_480_batch
      │   │   ├─ train_batch
      │   │   |     ├─ Gref_train_0.npz
      │   │   |     ├─ Gref_train_1.npz
      │   │   |     └─ ...
      |   |   ├─ train_image
      │   │   ├─ train_label 
      │   │   ├─ val_batch
      │   │   ├─ val_image
      │   │   └─ val_label
      │   ├─ unc_480_batch
      │   └─ unc+_480_batch
      ├─ referit
      │   └─ referit_480_batch
      │       ├─ trainval_batch
      │       └─ text_batch
      ├─ Gref_emb.npy
      ├─ referit_emb.npy
      ├─ vocabulary_Gref.txt
      └─ vocabulary_referit.txt

Training

python train_restr.py --data_dir ./data/mscoco/Gref_480_batch --adamW
python train_restr.py --data_dir ./data/mscoco/unc_480_batch --adamW
python train_restr.py --data_dir ./data/mscoco/unc+_480_batch --adamW
python train_restr.py --data_dir ./data/referit/referit_480_batch --set trainval --valset test --adamW

Evaluation

cd eval
python evaluate.py --data_dir ../data/mscoco/Gref_batch --restore_refseg ../weights/test --set val --iters 25000 --input-size 480,480 --is_vis

Citation

@inproceedings{kim2022restr,
  title={Restr: Convolution-free referring image segmentation using transformers},
  author={Kim, Namyup and Kim, Dongwon and Lan, Cuiling and Zeng, Wenjun and Kwak, Suha},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={18145--18154},
  year={2022}
}

Acknowledgement

This code is built upon the following public repositories.

restr's People

Contributors

southflame avatar

Stargazers

 avatar Seoyeon Kim avatar Dongwon Kim avatar mandos avatar Dahyun Kang avatar Sanghyun Kim avatar Minguk Kang avatar Chunghyun Park avatar Pierre avatar Kwonyoung Ryu avatar

Watchers

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