Code Monkey home page Code Monkey logo

eagrnet's Introduction

Edge-aware Graph Representation Learning and Reasoning for Face Parsing

The official repository of Edge-aware Graph Representation Learning and Reasoning for Face Parsing (ECCV 2020).

Installation

Our model is based on Pytorch 1.4.0 with Python 3.6.8. Also, we use In-Place Activated BatchNorm. First, you need to clone and compile inplace_abn.

git clone https://github.com/mapillary/inplace_abn.git
cd inplace_abn
python setup.py install
cd scripts
pip install -r requirements.txt

Data

You can download the Helen dataset on https://www.sifeiliu.net/face-parsing and imagenet pretrained resent-101 from baidu drive or Google drive, and put it into snapshot folder. We do not provide the registration code for the moment, and you need to organize input data as follows:

dataset/
    images/
    labels/
    edges/
    train_list.txt
    test_list.txt
        each line: 'images/100032540_1.jpg labels/100032540_1.png'

Besides, we provide the edge genearation code in the generate_edge.py.

Usage

We support single-gpu and multi-gpu training. Inplace-abn requires pytorch distributed data parallel.

Single gpu training

python train.py --data-dir ./dataset/Helen/ --random-mirror --random-scale --gpu 0 --learning-rate 1e-3 --weight-decay 5e-4 --batch-size 7 --input-size 473,473 --snapshot-dir ./snapshots/ --dataset train --num-classes 11 --epochs 200

Distributed(multi-gpu) training

CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 train.py --data-dir ./dataset/Helen/ --random-mirror --random-scale --gpu 0,1,2,3 --learning-rate 1e-3 --weight-decay 5e-4 --batch-size 7 --input-size 473,473 --snapshot-dir ./snapshots/ --dataset train --num-classes 11 --epochs 99

Validation

python evaluate.py --data-dir ./dataset/Helen/ --restore-from ./snapshots/helen/best.pth --gpu 0 --batch-size 7 --input-size 473,473 --dataset test --num-classes 11

Reference

If you consider use our code, please cite our paper:

@article{te2020edge,
  title={Edge-aware Graph Representation Learning and Reasoning for Face Parsing},
  author={Te, Gusi and Liu, Yinglu and Hu, Wei and Shi, Hailin and Mei, Tao},
  journal={arXiv preprint arXiv:2007.11240},
  year={2020}
}

eagrnet's People

Contributors

tegusi avatar

Watchers

 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.