Getting "ValueError: Failed to modify image" when dragging feature lines

#9
by mmacmahon - opened

After getting it setup locally, I ran into the following error below. This happens after I upload an image and the facelines are applied (with option to show feature lines when hovering over them). When I try to drag the curves to modify the face, this error pops up:

"ValueError: Failed to modify image: OpenCV(4.8.1) /io/opencv/modules/imgproc/src/imgwarp.cpp:2729: error: (-215:Assertion failed) src.cols > 0 && src.rows > 0 in function 'warpAffine'"

The image I uploaded was a .png, which I exported with alpha explicitly disabled (separately, I got an error "could not broadcast input array from shape (512,512,4) into shape (512,512,3)" when there was an alpha channel in the image).

Thanks for any help with this!

ah, I think I had this error once, it happened indeed when the image couldn't be loaded / parser / interpreted on the server side

What happens if you try with another image? Eg the same PNG but converted to WebP?

@jbilcke thanks for the tip! Tried exporting my test img at webp, jpg, gif, and tiff to test and none worked. I also saved out some online images just to make sure it wasn't an issue with this particular file. Are there known filetypes or issues with image size/filetype?

I think this is related to this:

https://huggingface.co./spaces/jbilcke-hf/FacePoke/discussions/11

EDIT - yes this is the same issue - and same possible resolution

I will look into it tomorrow, I'm setting myself a reminder

hey @mmacmahon I think this new update should fix it:
https://huggingface.co./spaces/jbilcke-hf/FacePoke/commit/1a40fccab736d775eaffe2713fdc5286743022ab

I've deployed this fix to production

does that solve the issue when you try with your image?

I will close this issue as normally this is now now fixed, it should not come back

but do not hesitate to re-open a new one if you see any other problem

jbilcke-hf changed discussion status to closed

Sign up or log in to comment