face-makeup.PyTorch icon indicating copy to clipboard operation
face-makeup.PyTorch copied to clipboard

Error IndexError: boolean index did not match indexed array along dimension 0; dimension is 780 but corresponding boolean dimension is 799

Open amitkayal opened this issue 4 years ago • 3 comments

Hi,

Getting the following error. Is this due to size mismatch?

Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /root/.cache/torch/hub/checkpoints/resnet18-5c106cde.pth 100% 44.7M/44.7M [00:00<00:00, 307MB/s] Traceback (most recent call last): File "makeup.py", line 86, in image = hair(image, parsing, part, color) File "makeup.py", line 54, in hair changed[parsing != part] = image[parsing != part] IndexError: boolean index did not match indexed array along dimension 0; dimension is 780 but corresponding boolean dimension is 799

amitkayal avatar Nov 09 '20 17:11 amitkayal

Here is the input file girl-no-makeup

amitkayal avatar Nov 09 '20 18:11 amitkayal

Hi @amitkayal

You can add np.repeat(parsing[:, :, np.newaxis], 3, axis=2) to hair function. It works

yaroslavmavliutov avatar Apr 06 '21 15:04 yaroslavmavliutov

Hi @amitkayal

You can add np.repeat(parsing[:, :, np.newaxis], 3, axis=2) to hair function. It works

hi, where should I add this code?

qihuijia avatar Aug 07 '23 21:08 qihuijia