Spaces:
Runtime error
Runtime error
File size: 1,116 Bytes
628b0eb |
1 |
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: image_mod_default_image"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from gradio.media import get_image\n", "\n", "def image_mod(image):\n", " return image.rotate(45)\n", "\n", "# get_image() returns file paths to sample media included with Gradio\n", "cheetah = get_image(\"cheetah1.jpg\")\n", "\n", "demo = gr.Interface(image_mod, gr.Image(type=\"pil\", value=cheetah), \"image\",\n", " flagging_options=[\"blurry\", \"incorrect\", \"other\"], examples=[\n", " get_image(\"lion.jpg\"),\n", " get_image(\"logo.png\")\n", " ])\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch(max_file_size=\"70kb\")\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} |