IP Library › Granted Patent US 11,526,967
Granted Patent B2
US 11,526,967 · App. 16/950,835 · Granted Dec 13, 2022

System and method for precise image inpainting to remove unwanted content from digital images

Inventors: Wenbo Li (Santa Clara, CA); Hongxia Jin (San Jose, CA)
Assignee: Samsung Electronics Co., Ltd.
G06T5/005G06T5/50G06T2207/20021G06T2207/20221
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,526,967
App. No.
16/950,835
Granted
Dec 13, 2022
Kind
B2
Abstract

An inpainting method includes retrieving image information at an electronic device, where the image information identifies an area within an image. The method also includes retrieving, using the electronic device, semantic information including a plurality of semantic classes and a semantic class distribution for each semantic class of the plurality of semantic classes. The method further includes generating semantic codes associated with different portions of the image based on the image information and the semantic information. In addition, the method includes constructing the area within the image by generating image content based on the semantic information.

Claims (81)

1. An inpainting method comprising:

obtaining image information at an electronic device, wherein the image information identifies an area within an image to be replaced;

obtaining, using the electronic device, semantic information associated with semantic content of the image, the semantic information including a plurality of semantic classes and a semantic class distribution for each semantic class of the plurality of semantic classes;

generating semantic codes associated with different portions of the image based on the image information and the semantic information; and

generating replacement image content for the area within the image based on the semantic codes.

2. The inpainting method of claim 1 , wherein generating the semantic codes comprises:

for each portion of the image that does not include at least part of the area within the image, generating a semantic code vector for that portion of the image; and

for each portion of the image that does include at least part of the area within the image, (i) identifying a semantic class of the plurality of semantic classes associated with that portion of the image and (ii) generating a semantic code vector for that portion of the image based on one or more neighboring semantic code vectors associated with that identified semantic class.

3. The inpainting method of claim 1 , further comprising:

generating a first feature map of a first semantic class of the plurality of semantic classes, the first feature map masked based on one or more portions of a filled semantic mask associated with the first semantic class;

generating a second feature map of a second semantic class of the plurality of semantic classes, the second feature map masked based on one or more portions of the filled semantic mask associated with the second semantic class; and

generating an initial image feature map based on aggregating the first and second feature maps.

4. The inpainting method of claim 3 , wherein:

the first feature map is based on a first subset of semantic code vectors, the first subset of semantic code vectors including (i) semantic code vectors for one or more portions of the image containing image data of the first semantic class and (ii) masked semantic code vectors for one or more portions of the image containing image data of the second semantic class; and

the second feature map is based on a second subset of semantic code vectors, the second subset of semantic code vectors including (i) semantic code vectors for the one or more portions of the image containing the image data of the second semantic class and (ii) masked semantic code vectors for the one or more portions of the image containing the image data of the first semantic class.

5. The inpainting method of claim 3 , further comprising:

refining one or more regions of the initial image feature map for each semantic class via fusing with the semantic information through location- and class-wise adaptive instance normalization in order to generate a raw output image;

wherein generating the replacement image content for the area within the image comprises blending the raw output image and the image.

6. The inpainting method of claim 5 , wherein the location- and class-wise adaptive instance normalization comprises:

dividing a feature map into multiple sub-feature maps, each sub-feature map associated with a different semantic code vector, each semantic code vector representing one of the semantic codes;

generating bias and slope vectors for each semantic code vector; and

modifying each sub-feature map using the bias and slope vectors for the semantic code vector associated with that sub-feature map to generate transformed sub-feature maps.

7. The inpainting method of claim 1 , wherein:

the semantic codes are based on (i) the image, (ii) a semantic mask with a hole associated with the area within the image, and (iii) a filled semantic mask with the hole filled with estimated semantic class labels; and

generating the replacement image content for the area within the image comprises:

generating an initial image feature map associated with the image, the initial image feature map based on (i) the semantic codes and (ii) the filled semantic mask; and

generating a final output image associated with the image, the final output image based on (i) the semantic codes and (ii) the initial image feature map.

8. An apparatus comprising:

at least one processor configured to:

obtain image information, wherein the image information identifies an area within an image to be replaced;

obtain semantic information associated with semantic content of the image, the semantic information including a plurality of semantic classes and a semantic class distribution for each semantic class of the plurality of semantic classes;

generate semantic codes associated with different portions of the image based on the image information and the semantic information; and

generate replacement image content for the area within the image based on the semantic codes.

9. The apparatus of claim 8 , wherein, to generate the semantic codes, the at least one processor is configured to:

for each portion of the image that does not include at least part of the area within the image, generate a semantic code vector for that portion of the image; and

for each portion of the image that does include at least part of the area within the image, (i) identify a semantic class of the plurality of semantic classes associated with that portion of the image and (ii) generate a semantic code vector for that portion of the image based on one or more neighboring semantic code vectors associated with that identified semantic class.

10. The apparatus of claim 8 , wherein the at least one processor is further configured to:

generate a first feature map of a first semantic class of the plurality of semantic classes, the first feature map masked based on one or more portions of a filled semantic mask associated with the first semantic class;

generate a second feature map of a second semantic class of the plurality of semantic classes, the second feature map masked based on one or more portions of the filled semantic mask associated with the second semantic class; and

generate an initial image feature map based on aggregating the first and second feature maps.

11. The apparatus of claim 10 , wherein:

the first feature map is based on a first subset of semantic code vectors, the first subset of semantic code vectors including (i) semantic code vectors for one or more portions of the image containing image data of the first semantic class and (ii) masked semantic code vectors for one or more portions of the image containing image data of the second semantic class; and

the second feature map is based on a second subset of semantic code vectors, the second subset of semantic code vectors including (i) semantic code vectors for the one or more portions of the image containing the image data of the second semantic class and (ii) masked semantic code vectors for the one or more portions of the image containing the image data of the first semantic class.

12. The apparatus of claim 10 , wherein:

the at least one processor is further configured to refine one or more regions of the initial image feature map for each semantic class via fusing with the semantic information through location- and class-wise adaptive instance normalization in order to generate a raw output image; and

to generate the replacement image content for the area within the image, the at least one processor is configured to blend the raw output image and the image.

13. The apparatus of claim 12 , wherein, to perform the location and class-wise adaptive instance normalization, the at least one processor is configured to:

divide a feature map into multiple sub-feature maps, each sub-feature map associated with a different semantic code vector, each semantic code vector representing one of the semantic codes;

generate bias and slope vectors for each semantic code vector; and

modify each sub-feature map using the bias and slope vectors for the semantic code vector associated with that sub-feature map to generate transformed sub-feature maps.

14. The apparatus of claim 8 , wherein:

the semantic codes are based on (i) the image, (ii) a semantic mask with a hole associated with the area within the image, and (iii) a filled semantic mask with the hole filled with estimated semantic class labels; and

to generate the replacement image content for the area within the image, the at least one processor is configured to:

generate an initial image feature map associated with the image, the initial image feature map based on (i) the semantic codes and (ii) the filled semantic mask; and

generate a final output image associated with the image, the final output image based on (i) the semantic codes and (ii) the initial image feature map.

15. A non-transitory computer readable medium containing instructions that when executed cause at least one processor to:

obtain image information, wherein the image information identifies an area within an image to be replaced;

obtain semantic information associated with semantic content of the image, the semantic information including a plurality of semantic classes and a semantic class distribution for each semantic class of the plurality of semantic classes;

generate semantic codes associated with different portions of the image based on the image information and the semantic information; and

generate replacement image content for the area within the image based on the semantic codes.

16. The non-transitory computer readable medium of claim 15 , wherein the instructions that cause the at least one processor to generate the semantic codes comprise instructions that cause the at least one processor to:

for each portion of the image that does not include at least part of the area within the image, generate a semantic code vector for that portion of the image; and

for each portion of the image that does include at least part of the area within the image, (i) identify a semantic class of the plurality of semantic classes associated with that portion of the image and (ii) generate a semantic code vector for that portion of the image based on one or more neighboring semantic code vectors associated with that identified semantic class.

17. The non-transitory computer readable medium of claim 15 , further containing instructions when executed cause the at least one processor to:

generate a first feature map of a first semantic class of the plurality of semantic classes, the first feature map masked based on one or more portions of a filled semantic mask associated with the first semantic class;

generate a second feature map of a second semantic class of the plurality of semantic classes, the second feature map masked based on one or more portions of the filled semantic mask associated with the second semantic class; and

generate an initial image feature map based on aggregating the first and second feature maps.

18. The non-transitory computer readable medium of claim 17 , wherein:

the first feature map is based on a first subset of semantic code vectors, the first subset of semantic code vectors including (i) semantic code vectors for one or more portions of the image containing image data of the first semantic class and (ii) masked semantic code vectors for one or more portions of the image containing image data of the second semantic class; and

the second feature map is based on a second subset of semantic code vectors, the second subset of semantic code vectors including (i) semantic code vectors for the one or more portions of the image containing the image data of the second semantic class and (ii) masked semantic code vectors for the one or more portions of the image containing the image data of the first semantic class.

19. The non-transitory computer readable medium of claim 17 , further containing instructions that when executed cause the at least one processor to refine one or more regions of the initial image feature map for each semantic class via fusing with the semantic information through location- and class-wise adaptive instance normalization in order to generate a raw output image;

wherein the instructions that cause the at least one processor to generate the replacement image content for the area within the image comprise instructions that cause the at least one processor to blend the raw output image and the image.

20. The non-transitory computer readable medium of claim 19 , wherein the location- and class-wise adaptive instance normalization comprises:

dividing a feature map into multiple sub-feature maps, each sub-feature map associated with a different semantic code vector, each semantic code vector representing one of the semantic codes;

generating bias and slope vectors for each semantic code vector; and

modifying each sub-feature map using the bias and slope vectors for the semantic code vector associated with that sub-feature map to generate transformed sub-feature maps.

21. The non-transitory computer readable medium of claim 15 , wherein:

the semantic codes are based on (i) the image, (ii) a semantic mask with a hole associated with the area within the image, and (iii) a filled semantic mask with the hole filled with estimated semantic class labels; and

the instructions that cause the at least one processor to generate the replacement image content for the area within the image comprise instructions that cause the at least one processor to:

generate an initial image feature map associated with the image, the initial image feature map based on (i) the semantic codes and (ii) the filled semantic mask; and

generate a final output image associated with the image, the final output image based on (i) the semantic codes and (ii) the initial image feature map.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 17, 2020
From: LI, WENBO; JIN, HONGXIA
To: SAMSUNG ELECTRONICS CO., LTD.
Reel/Frame 054396/0111 →
Continuity (2)
Provisional Application 62940147 · Nov 25, 2019
Related Publication 20210158491A1 · May 27, 2021