-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Handle GIFs correct in gr.Image
preprocessing
#8589
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/3922d7a636b0f7cccf4643b233201aa6dbd104c3/gradio-4.36.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@3922d7a636b0f7cccf4643b233201aa6dbd104c3#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-builds.s3.amazonaws.com/3922d7a636b0f7cccf4643b233201aa6dbd104c3/gradio-client-1.1.1.tgz |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm i'm still seeing a very weird issue..
Screen.Recording.2024-06-20.at.1.30.42.PM.mov
vs main
Screen.Recording.2024-06-20.at.1.33.14.PM.mov
with just
import gradio as gr
gr.Interface(lambda x:x, "image", "image").launch()
Maybe i'm not supposed to use defaults for gifs?
Ok so basically by default, |
@abidlabs got it, but it only works for filepath. with pil it's the same issue as main. |
Yeah hmm let me see |
Oh okay so what's happening is that when a PIL image is passed into a import gradio as gr
demo = gr.Interface(lambda x:x, gr.Image(type="pil"), gr.Image(format="gif"))
demo.launch() or you can keep it as a filepath, like this: import gradio as gr
demo = gr.Interface(lambda x:x, gr.Image(type="filepath"), "image")
demo.launch() Slightly confusing, but I think its best we can do without a breakage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i'm fine with it as is. Consider changing the docs a bit. You could even add a section on GIFs :)
Thanks!
Yeah I'll do that! |
We can finally handle GIFs in
gr.Image
closing one of our oldest issues! Fixes: #1965, Fixes: #5174Also removes up some old methods that are not used anymore