gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.31k stars 2.51k forks source link

gr.Image() with color-sketch on macos upload image size is changed #6877

Open rivergold opened 10 months ago

rivergold commented 10 months ago

Describe the bug

gradio==3.50.2

when using gr.Image() with color-sketch on macos, the image which uploaded, the size is changed.

This bug doesn't occur on Windows and Linux.

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

with gr.Blocks() as seg2img_interface:
    # Mask img
    widget_mask_img = gr.Image(
        type='pil',
        tool='color-sketch',
        width=1024,
        height=768,
        interactive=True,
        brush_color='#2E8B57',
        brush_radius=40,
        visible=True)

Screenshot

The raw image, which size is 1024*576

seg2img-mask

The upload image size is 2048 * 1152

Logs

No response

System Info

Gradio Environment Information:                                                                                                          ------------------------------                                                                                                           Operating System: Linux                                                                                                                  gradio version: 3.50.2                                                                                                                   gradio_client version: 0.6.1                                                                                                                                                                                                                                                      ------------------------------------------------                                                                                         gradio dependencies in your environment:                                                                                                                                                                                                                                          aiofiles: 23.2.1                                                                                                                         altair: 5.1.1                                                                                                                            fastapi: 0.103.1                                                                                                                         ffmpy: 0.3.1
gradio-client==0.6.1 is not installed.
httpx: 0.25.0
huggingface-hub: 0.20.1
importlib-resources: 6.1.0
jinja2: 3.1.2                                                                                                                            markupsafe: 2.1.1                                                                                                                        matplotlib: 3.8.0                                                                                                                        numpy: 1.25.2
orjson: 3.9.7
packaging: 23.1
pandas: 2.1.1
pillow: 9.4.0
pydantic: 2.3.0
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
requests: 2.31.0
semantic-version: 2.10.0
typing-extensions: 4.7.1
uvicorn: 0.23.2
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.9.2
httpx: 0.25.0
huggingface-hub: 0.20.1
packaging: 23.1
requests: 2.31.0
typing-extensions: 4.7.1
websockets: 11.0.3

Severity

Blocking usage of gradio

abidlabs commented 2 days ago

Hi, apologies for the late follow up. We haven't had a chance to look into this issue, but the Gradio codebase has changed quite significantly since this issue was created, particularly with the release of Gradio 5. Could you let us know if this is still an issue in the latest version of Gradio (pip install --upgrade gradio)? Thanks!