-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with inpainting image input #1721
Comments
Finding that manual mask drawing is not supported for almost any uploaded image for the LAMA model https://huggingface.co/spaces/akhaliq/lama Only the default image works. This is using Brave Browser (Chromium... Version 1.37.116 Chromium: 100.0.4896.127 (Official Build) (64-bit) ). For square uploaded images, I notice that the white circle showing the mask drawing location appears about 150 pixels down and to the right of the mouse pointer. For most images, however, be they square or rectangular, simply no mask drawing is possible. |
Thanks @drscotthawley, we'll take a look! |
This is a scaling issue with very large images, as I understand it. The image and UI is downscaled when the image is very large. We need to scale the image independent of the UI and scale the painted region to the size of the image in order for it to appear correctly. |
Pretty sure I'm wrong, these images aren't even that big. Investigating. |
The default image issue also affected using the sketch as an output, the simple reason for this is we simple didn't support that use case, which is a huge oversight and a bug. This is easily addressed. The issue of the drawing tool not being available is actually slightly trickier. The scaling is wrong, per my previous comments, but there is an additional bug in that the canvas is set up only once and not refreshed when the base image changes. This is fine for the old sketch (with no bg image) but not for the new one. The brush size is also only set up once and never changes, however, the brush position does get updated (once per frame when the mouse moves). This combination of some things not getting updated + rescaled (the canvas is actually very large and gets rescaled, thus the brush position has to be scaled accordingly) and others refreshing every frame leads to the brush appearing in strange locations. If the two images aren't too different in size then the brush position is just slightly offset from the cursor, however, when the difference is greater the brush can appear offscreen. If you hard reload the page every time then all of these images work roughly as expected (with some weird brush scaling), you also get different behaviour depending on which image you use first. I'll actually just change the way we scale everything to make this problem go away. |
Not sure if this is the best place, but putting some thoughts down around the various modes of the What use cases does the Image component need to serve?On the Python side, users want…
Note: I do not think we'll need image + binary mask + sketch On the front end,
Gradio API:
What does frontend send to the backend? (Or if the Space is used as an API, what is returned?)
|
Describe the bug
This demo uses the new image input (
gr.Image(tool="sketch", label="Input",type="numpy")
): https://huggingface.co/spaces/akhaliq/lamaHowever, when examples are added to the demo, clicking on the examples does not populate the inpainting image input. Instead, you get a blank gray rectangle there:
Is there an existing issue for this?
Reproduction
https://huggingface.co/spaces/akhaliq/lama
Screenshot
No response
Logs
System Info
Severity
serious, but I can work around it
The text was updated successfully, but these errors were encountered: