Version 3.4
New Features
1. Gallery Captions 🖼️
You can now pass captions to images in the Gallery component. To do so you need to pass a {List} of (image, {str} caption) tuples. This is optional and the component also accepts just a list of the images.
Here's an example:
import gradio as gr
images_with_captions = [
("https://images.unsplash.com/photo-1551969014-7d2c4cddf0b6", "Cheetah by David Groves"),
("https://images.unsplash.com/photo-1546182990-dffeafbe841d", "Lion by Francesco"),
("https://images.unsplash.com/photo-1561731216-c3a4d99437d5", "Tiger by Mike Marrah")
]
with gr.Blocks() as demo:
gr.Gallery(value=images_with_captions)
demo.launch()
2. Type Values into the Slider 🔢
You can now type values directly on the Slider component! Here's what it looks like:
3. Better Sketching and Inpainting 🎨
We've made a lot of changes to our Image component so that it can support better sketching and inpainting.
Now supports:
- A standalone black-and-white sketch
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Sketchpad(), gr.Image())
demo.launch()
- A standalone color sketch
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Paint(), gr.Image())
demo.launch()
- An uploadable image with black-and-white or color sketching
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Image(source='upload', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch'
demo.launch()
- Webcam with black-and-white or color sketching
import gradio as gr
demo = gr.Interface(lambda x: x, gr.Image(source='webcam', tool='color-sketch'), gr.Image()) # for black and white, tool = 'sketch'
demo.launch()
As well as other fixes
Bug Fixes
- Fix bug where max concurrency count is not respected in queue by @freddyaboulton in #2286
- fix : queue could be blocked by @SkyTNT in #2288
- Supports
gr.update()
in example caching by @abidlabs in #2309 - Clipboard fix for iframes by @abidlabs in #2321
- Fix: Dataframe column headers are reset when you add a new column by @dawoodkhan82 in #2318
- Added support for URLs for Video, Audio, and Image by @abidlabs in #2256
- Add documentation about how to create and use the Gradio FastAPI app by @abidlabs in #2263
Documentation Changes
- Adding a Playground Tab to the Website by @aliabd in #1860
- Gradio for Tabular Data Science Workflows Guide by @merveenoyan in #2199
- Promotes
postprocess
andpreprocess
to documented parameters by @abidlabs in #2293 - Update 2)key_features.md by @voidxd in #2326
- Add docs to blocks context postprocessing function by @Ian-GL in #2332
Testing and Infrastructure Changes
- Website fixes and refactoring by @aliabd in #2280
- Don't deploy to spaces on release by @freddyaboulton in #2313
What's Changed
- Website fixes and refactoring by @aliabd in #2280
- Fix bug where max concurrency count is not respected in queue by @freddyaboulton in #2286
- Promotes
postprocess
andpreprocess
to documented parameters by @abidlabs in #2293 - Raise warning when trying to cache examples but not all inputs have examples by @freddyaboulton in #2279
- fix : queue could be blocked by @SkyTNT in #2288
- Don't deploy to spaces on release by @freddyaboulton in #2313
- Supports
gr.update()
in example caching by @abidlabs in #2309 - Respect Upstream Queue when loading interfaces/blocks from Spaces by @freddyaboulton in #2294
- Clipboard fix for iframes by @abidlabs in #2321
- Sketching + Inpainting Capabilities to Gradio by @abidlabs in #2144
- Update 2)key_features.md by @voidxd in #2326
- release 3.4b3 by @abidlabs in #2328
- Fix: Dataframe column headers are reset when you add a new column by @dawoodkhan82 in #2318
- Start queue when gradio is a sub application by @freddyaboulton in #2319
- Fix Web Tracker Script by @aliabd in #2308
- Add docs to blocks context postprocessing function by @Ian-GL in #2332
- Fix typo in iterator variable name in run_predict function by @freddyaboulton in #2340
- Add captions to galleries by @aliabid94 in #2284
- Typeable value on gradio.Slider by @dawoodkhan82 in #2329
New Contributors
Full Changelog: v3.3.1...v3.4