Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- requirements.txt +2 -2
- run.ipynb +1 -1
- run.py +5 -4
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
2 |
-
https://gradio-pypi-previews.s3.amazonaws.com/
|
|
|
1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@070463cf85f75f1a327a2c0daa6eea81467ad749#subdirectory=client/python
|
2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/070463cf85f75f1a327a2c0daa6eea81467ad749/gradio-5.47.2-py3-none-any.whl
|
run.ipynb
CHANGED
@@ -1 +1 @@
|
|
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": ["
|
|
|
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}
|
run.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
|
4 |
def image_mod(image):
|
5 |
return image.rotate(45)
|
6 |
|
7 |
-
|
|
|
8 |
|
9 |
demo = gr.Interface(image_mod, gr.Image(type="pil", value=cheetah), "image",
|
10 |
flagging_options=["blurry", "incorrect", "other"], examples=[
|
11 |
-
|
12 |
-
|
13 |
])
|
14 |
|
15 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
+
from gradio.media import get_image
|
3 |
|
4 |
def image_mod(image):
|
5 |
return image.rotate(45)
|
6 |
|
7 |
+
# get_image() returns file paths to sample media included with Gradio
|
8 |
+
cheetah = get_image("cheetah1.jpg")
|
9 |
|
10 |
demo = gr.Interface(image_mod, gr.Image(type="pil", value=cheetah), "image",
|
11 |
flagging_options=["blurry", "incorrect", "other"], examples=[
|
12 |
+
get_image("lion.jpg"),
|
13 |
+
get_image("logo.png")
|
14 |
])
|
15 |
|
16 |
if __name__ == "__main__":
|