Towards Interactive Image Inpainting via Sketch Refinement
Chang Liu, Shunxin Xu, Jialun Peng, Kaidong Zhang, Dong Liu
TL;DR
SketchRefiner tackles interactive image inpainting by separating sketch refinement from inpainting, using a two-stage design to robustly leverage user sketches. The SRN employs a Registration Module and Enhancement Module with a novel cross-correlation loss to align and coherently refine sketches, while SIN modulates inpainting through a Partial Sketch Encoder and Sketch Feature Aggregation, feeding a Texture Restoration Module. A Sketch Simulation Algorithm and a real-world sketch-based test protocol are introduced to address data scarcity and evaluate practical performance. Across ImageNet, Places2, and CelebA-HQ, SketchRefiner consistently outperforms state-of-the-art methods in both quantitative metrics (PSNR/SSIM/FID) and perceptual quality, demonstrating strong potential for real-world sketch-guided editing. Limitations include occasional over-refinement and restriction to monochrome sketches, with future work aimed at balancing sketch control and robustness to input randomness.
Abstract
One tough problem of image inpainting is to restore complex structures in the corrupted regions. It motivates interactive image inpainting which leverages additional hints, e.g., sketches, to assist the inpainting process. Sketch is simple and intuitive to end users, but meanwhile has free forms with much randomness. Such randomness may confuse the inpainting models, and incur severe artifacts in completed images. To address this problem, we propose a two-stage image inpainting method termed SketchRefiner. In the first stage, we propose using a cross-correlation loss function to robustly calibrate and refine the user-provided sketches in a coarse-to-fine fashion. In the second stage, we learn to extract informative features from the abstracted sketches in the feature space and modulate the inpainting process. We also propose an algorithm to simulate real sketches automatically and build a test protocol with different applications. Experimental results on public datasets demonstrate that SketchRefiner effectively utilizes sketch information and eliminates the artifacts due to the free-form sketches. Our method consistently outperforms the state-of-the-art ones both qualitatively and quantitatively, meanwhile revealing great potential in real-world applications. Our code and dataset are available.
