This repository contains the official implementation of "Deep Flexible Structure Preserving Image Smoothing" [ACM DL][self-hosted], which appeared in ACM Multimedia 2022.
Demo is avaliable at here!
The released checkpoints are trained with BSDS500 Train-set and the first 10000 image (in the ascending alphabetical order of their filename) from MS-COCO.
pytorch >= 1.6
torchvision
numpy
The code of our heuristic component drop can be found here.
Please install component drop first.
First, download pre-computed edge maps from link and train adjuster as follows:
python train_adjuster.py --train_dir=<COCO training image dir> --edge_dir=<COCO_edge> --workdir=./train_adjuster
Then train smoother as follows :
python train_smoother.py --train_dataset_path=<COCO train image dir> --val_dataset_path=<COCO val image dir> --workdir=./train_smoother
Inference is quite simple, as the example below.
python batch_inference.py \
--save_dir=./result \
--batch_size=1 \
--checkpoints_dir=./checkpoints \
--image_dir=./test_image \
--lamb=0.6,0.5,0.4
You can also use our online demo at here
The results on BSDS500 test/val sets can be found here.