IMAGE COMPLEMENTATION STACK SOLUTION METHOD IN SIGGRAPH 2017_impainting

Asked 2 years ago, Updated 2 years ago, 100 views

I'm a beginner at programming and I've only touched the code for a few days, but I really wanted to supplement the image with AI, so I started programming that I'm not used to.

What you tried
SIGGRAPH thesis

I spent a few days on my own building the environment using Docker and Ubuntu's LTS version 20.4 to install and use the package.However, this error occurred in the process of complementing the image and it continues to stack.

root@82a52e3b8c9f:/mount#thimpaint.lua --input example.png --mask example_mask.png
{
gpu —false
mask: "example_mask.png"
postproc:false
model: "completionnet_places2_freeform.t7"
maxdim —600
input: "example.png"
}
Loading model...
/root/torch/install/bin/luajit:impaint.lua:78:inconsistent tensor size, expected
tensor [4 x 336 x 600] and mask [3 x 336 x 600] to have the same number of elements,
but got 806400 and 604800 elements respectively at
/root/torch/pkg/torch/lib/TH/generic/THTensorMath.c:138
stack traceback:
[C]: in function 'maskedFill'
impaint.lua:78:in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150:in main chunk
[C]—at 0x00405d50

I looked up the error code on the Internet, but I'm at a loss because nothing fits me well.As an amateur, the size of the image was unified, and I made it with example.png and example_mask.png with the first name.However, it has not been resolved at all.

And there was no article in the SIGGRAPH paper that said such an error occurred, and I couldn't find a way to correct it, and I was so angry that I couldn't help but wonder why I was the only one who had to go through this.Can someone solve this problem?

lua torch

2022-09-30 16:56

1 Answers

/root/torch/install/bin/luajit:impaint.lua:78:inconsistent sensor size, expected
tensor [4 x 336 x 600] and mask [3 x 336 x 600] to have the same number of elements,
butgot 806400 and 604800 elements respectively at

Looking at the error message, it seems that the reason for the error is that the number of channels in the PNG file is different.You will need to match the number of channels between the input image and the mask image.
今回 In this case, there seems to be no alpha channel in the mask image.

Note: For some reason, there are three PNG format differences


2022-09-30 16:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.