Heartbeat

Comet is a machine learning platform helping data scientists, ML engineers, and deep learning engineers build better models faster

Follow publication

Guide to Image Inpainting: Using machine learning to edit and correct defects in photos

Jamshed Khan
Heartbeat
Published in
12 min readAug 7, 2019

--

This view from my school would be just the sort of thing Inpainting could improve.

What is Image Inpainting?

Source

A newsletter for machine learners — by machine learners. Sign up to receive our weekly dive into all things ML, curated by our experts in the field.

A New Approach with Machine Learning

Courtesy : NVIDIA
Comparison of various inpainting approaches
Globally and Locally Consistent Image Completion (Iizuka et. al.)
Comparison of test results from Celeba-HQ (above) and ImageNet (below) datasets.
The Fast Marching method(left). Taking a small neighborhood Bε(p) of size ε of the known image around a point p, one must inpaint p situated on the boundary ∂Ω of the region to inpaint Ω. A thick region to inpaint needs weights in accordance(right).
import numpy as np
import cv2
img = cv2.imread('messi_2.jpg')
mask = cv2.imread('mask2.png',0)
dst = cv2.inpaint(img,mask,3,cv2.INPAINT_TELEA)
cv2.imshow('dst',dst)
cv2.waitKey(0)
cv2.destroyAllWindows()

Further Research

SC-FEGAN can be used to make realistic edits to images by providing a free-form mask, a sketch and colors as an input.

SC-FEGAN

Network Architecture of SC-FEGAN

EdgeConnect

(Left to Right) Original image, Input image, generated edges (blue lines denote hallucinated edges), Inpainted results without any post-processing.

Pluralistic Image Completion

Numerous possibilities can exist when it comes to image completion, especially when the gaps are bigger.
Source : Github

Conclusion

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Comet is a machine learning platform helping data scientists, ML engineers, and deep learning engineers build better models faster

No responses yet

Write a response