Code Monkey home page Code Monkey logo

pytorch-hair-segmentation's Introduction

pytorch-hair-segmentation

Implementation of pytorch semantic segmentation with figaro-1k.

Prerequisites

opencv-contrib-python 3.4.4
pytorch 0.4.1
torchvision 0.2.1
numpy 1.14.5

Downloading dataset

# specify a directory for dataset to be downloaded into, else default is ./data/
sh data/figaro.sh #<directory>

Running trainer

# sample execution

python3 main.py \
  --networks mobilenet \
  --dataset figaro \
  --data_dir ./data/Figaro1k \
  --scheduler ReduceLROnPlateau \
  --batch_size 4 \
  --epochs 5 \
  --lr 1e-3 \
  --num_workers 2 \
  --optimizer adam \
  --img_size 256 \
  --momentum 0.5 \
  --ignite True
  • You should add your own model script in networks and make it avaliable in get_network in ./networks/__init__.py

Running docker & train

with ignite

docker run davinnovation/pytorch-hairsegment:cpu python main.py

with no-ignite

docker run -p davinnovation/pytorch-hairsegment:cpu python main.py --ignite False

Evaluating model

# sample execution

python3 evaluate.py \
  --networks pspnet_resnet101 \
  --ckpt_dir [path to checkpoint] \
  --dataset figaro \
  --data_dir ./data/Figaro1k \
  --save_dir ./overlay/ \
  --use_gpu True

Evaluation result on figaro testset

Model IoU F1-score Checkpoint
pspnet_resnet101 0.92 0.96 link
pspnet_squeezenet 0.88 0.91 link
deeplabv3plus 0.80 0.89 -

Sample visualization

  • Red: GT / Blue: Segmentation Map

sample_0 sample_1 sample_2 sample_3 sample_4

pytorch-hair-segmentation's People

Contributors

jooong avatar davinnovation avatar suvojit-0x55aa 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.