mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
9b42ba8f10
* changes * changes * revert changes * changes * add changeset * notebooks script * changes * changes --------- Co-authored-by: Ali Abid <aliabid94@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
1.7 KiB
1.7 KiB
Gradio Demo: image_mod_default_image¶
In [ ]:
!pip install -q gradio
In [ ]:
# Downloading files from the demo repo import os os.mkdir('images') !wget -q -O images/cheetah1.jpg https://github.com/gradio-app/gradio/raw/main/demo/image_mod_default_image/images/cheetah1.jpg !wget -q -O images/lion.jpg https://github.com/gradio-app/gradio/raw/main/demo/image_mod_default_image/images/lion.jpg !wget -q -O images/logo.png https://github.com/gradio-app/gradio/raw/main/demo/image_mod_default_image/images/logo.png
In [ ]:
import gradio as gr import os def image_mod(image): return image.rotate(45) cheetah = os.path.join(os.path.abspath(''), "images/cheetah1.jpg") demo = gr.Interface(image_mod, gr.Image(type="pil", value=cheetah), "image", flagging_options=["blurry", "incorrect", "other"], examples=[ os.path.join(os.path.abspath(''), "images/lion.jpg"), os.path.join(os.path.abspath(''), "images/logo.png") ]) if __name__ == "__main__": demo.launch(max_file_size="70kb")