← all repositories
Joker316701882/Deep-Image-Matting

A research reproduction that admits defeat in real time

TensorFlow implementation of Deep Image Matting where the author documents every wrong turn, dead end, and "maybe I didn't train enough time" along the way.

624 stars Python Computer Vision
Deep-Image-Matting
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

Reproduces a 2017 CVPR paper on deep image matting — the task of extracting foreground objects from images with soft edges like hair or fur. The network uses a VGG-16 encoder and custom decoder with unpooling layers, trained to predict alpha mattes from RGB images and trimaps.

The interesting bit

The README is essentially a lab notebook of failure. The author publicly tracks their mistakes: deconvolution layers that can’t learn hair detail, a missing ‘fc6’ layer discovered months later, preprocessing order causing ground-truth shifts “hard to tell by eye,” and the fatal realization that random erosion matters as much as random dilation for trimap generation. The pretrained model was accidentally deleted and never recovered.

Key highlights

  • Encoder-decoder architecture with VGG-16 backbone and unpooling-based decoder (switched from deconvolution after experiments showed worse detail)
  • Training code includes “hard mode” for difficult samples and tensorboard logging on alphamatting dataset
  • Author identifies three specific improvements from community issues: use author’s original preprocessing code, apply both random dilation and erosion for trimaps, and test at original image size (or nearest multiple of 32)
  • Includes inference code and sample test data despite missing pretrained weights
  • Links to related salient object detection work with available trained model

Caveats

  • No pretrained model available (accidentally deleted, single copy)
  • Test code broken as of April 2018 due to unpool implementation changes; author has “no plan to modify this repo”
  • Explicitly states performance “can’t reach” paper results even on private data
  • Batch size reduced to 1 after unpooling switch; code described as “not decent now, just can work”
  • Training data is proprietary and unavailable

Verdict

Worth reading for anyone trying to reproduce a deep learning paper — it’s a rare public record of what actually goes wrong. Skip for production use; the author themselves abandoned it and planned a “brand new algorithm” restart.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.