Skip to content
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

ImagePaint unexcpectedly resizes image half automatically when used as output. #3138

Closed
1 task done
Tracked by #466
TkskKurumi opened this issue Feb 7, 2023 · 3 comments · Fixed by #6169
Closed
1 task done
Tracked by #466

ImagePaint unexcpectedly resizes image half automatically when used as output. #3138

TkskKurumi opened this issue Feb 7, 2023 · 3 comments · Fixed by #6169
Assignees
Labels
bug Something isn't working 🖼️ image Image component
Milestone

Comments

@TkskKurumi
Copy link

Describe the bug

Hi experts,

When I use an Image component as image uploading and sync (tested both with Image.upload or Button.submit) its image to an ImagePaint component, the image in the paint component iterates with image is resized half in each iteration, the .edit event is called without any user operation. Sorry I'm not good at expressing the problem but if you reproduce with the code below I think it'll be clear.

Thanks.

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

import gradio as gr
def debug(img):
    print(img.shape) # found that Image is resized halfsize many times until finaly tiny blur image
    return None
with gr.Blocks() as demo:
    
        
        im_orig = gr.Image(source="upload")
        im_paint = gr.ImagePaint()
    
        im_orig.upload(lambda x: x, inputs=im_orig, outputs=im_paint) # or use a button and with btn.submit

        im_paint.edit(debug, inputs=im_paint, outputs=[])
        
demo.launch(debug=True)

Screenshot

image

Logs

Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
(494, 494, 3)
(201, 201, 3)
(64, 64, 3)
(20, 20, 3)
(5, 5, 3)

System Info

Gradio: 3.17.1
Python: Python 3.10.8 | packaged by conda-forge | (main, Nov  4 2022, 13:42:51) [MSC v.1916 64 bit (AMD64)] on win32
Browser: Chrome 109.0.5414.120

Severity

annoying

@TkskKurumi TkskKurumi added the bug Something isn't working label Feb 7, 2023
@freddyaboulton
Copy link
Collaborator

Yea I can reproduce. The whole app slows down and becomes unusable regardless of whether the edit event is attached to im_paint

@abidlabs
Copy link
Member

I was hoping this was fixed as part of PR #3277 but I just tested and this is still an issue (just fyi @pngwn)

@abidlabs abidlabs added the 🖼️ image Image component label Feb 23, 2023
@pngwn
Copy link
Member

pngwn commented Feb 23, 2023

i will be happy to take a look. 🥲

@pngwn pngwn mentioned this issue Feb 23, 2023
20 tasks
@pngwn pngwn self-assigned this Feb 23, 2023
@abidlabs abidlabs added this to the 3.x milestone Mar 17, 2023
@abidlabs abidlabs removed this from the 3.x milestone May 9, 2023
@abidlabs abidlabs added this to the Component Cleanup milestone Jul 9, 2023
@hannahblair hannahblair assigned pngwn and unassigned pngwn Jul 31, 2023
@abidlabs abidlabs modified the milestones: Component Cleanup, 4.0 Aug 7, 2023
@abidlabs abidlabs modified the milestones: 4.0, 4.0-image Oct 23, 2023
@pngwn pngwn mentioned this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🖼️ image Image component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants