Giter Site home page Giter Site logo

pytorch-hed's Introduction

hed_pytorch

Pytorch implementation of Holistically-nested Edge Detection (HED). This repo can be used to train a HED model and perform test inference. The implementation was evaluated on the BSDS dataset.

Prerequisites

I use docker to avoid dependency problems. Installation instructions for my setup are available here.

Usage

  • Download repository:
    $ git clone https://github.com/buntyke/pytorch-hed.git
    
  • Create data folder, download and extract BSDS dataset into folder:
    $ cd pytorch-hed/
    $ mkdir data; cd data
    $ wget http://vcl.ucsd.edu/hed/HED-BSDS.tar
    $ tar -xvf HED-BSDS.tar
    $ rm HED-BSDS.tar
    $ cd HED-BSDS/
    $ head -n 10 train_pair.lst > val_pair.lst
    $ cd ../../
    
  • Download the VGG pretrained model to initialize training
    $ mkdir model; cd model/
    $ wget https://download.pytorch.org/models/vgg16-397923af.pth
    $ mv vgg16-397923af.pth vgg16.pth
    $ cd ..
    
  • Train HED model by running train.py or train.ipynb notebook following the instructions:
    $ python train.py 
    
    The trained model along with validation results are stored in the train folder.

Performance

Files

  • train.ipynb: Notebook to train HED model.
  • trainer.py: Helper class to train model and perform validation.
  • model.py: HED model definition given through several class implementations.
  • dataproc.py: Dataset class implementation used in Trainer class.

Acknowledgement

The source code is derived from three different implementations available online. Thanks to @s9xie for original caffe implementation. Thanks to @EliasVansteenkiste, @xlliu, @BinWang-shu for the pytorch implementations.

pytorch-hed's People

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.