Upload with huggingface_hub
Browse files- .gitattributes +1 -0
- files/a.mp4 +0 -0
- files/b.mp4 +0 -0
- files/world.mp4 +3 -0
- requirements.txt +1 -1
- run.ipynb +1 -1
- run.py +19 -5
.gitattributes
CHANGED
@@ -31,3 +31,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
31 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
32 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
33 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
31 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
32 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
33 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
34 |
+
files/world.mp4 filter=lfs diff=lfs merge=lfs -text
|
files/a.mp4
ADDED
Binary file (130 kB). View file
|
|
files/b.mp4
ADDED
Binary file (261 kB). View file
|
|
files/world.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:71944d7430c461f0cd6e7fd10cee7eb72786352a3678fc7bc0ae3d410f72aece
|
3 |
+
size 1570024
|
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
|
2 |
-
https://gradio-main-build.s3.amazonaws.com/
|
|
|
1 |
|
2 |
+
https://gradio-main-build.s3.amazonaws.com/a23bc03aeb62a11885eee3bc4f7ba316cd4e2c89/gradio-3.17.1-py3-none-any.whl
|
run.ipynb
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: video_component"]}, {"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: video_component"]}, {"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": ["# Downloading files from the demo repo\n", "import os\n", "os.mkdir('files')\n", "!wget -q -O files/a.mp4 https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/a.mp4\n", "!wget -q -O files/b.mp4 https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/b.mp4\n", "!wget -q -O files/world.mp4 https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/world.mp4"]}, {"cell_type": "code", "execution_count": null, "id": 44380577570523278879349135829904343037, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "import os\n", "\n", "\n", "a = os.path.join(os.path.abspath(''), \"files/world.mp4\") # Video\n", "b = os.path.join(os.path.abspath(''), \"files/a.mp4\") # Video\n", "c = os.path.join(os.path.abspath(''), \"files/b.mp4\") # Video\n", "\n", "\n", "demo = gr.Interface(\n", " fn=lambda x: x,\n", " inputs=gr.Video(type=\"file\"),\n", " outputs=gr.Video(),\n", " examples=[\n", " [a],\n", " [b],\n", " [c],\n", " ],\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
@@ -1,8 +1,22 @@
|
|
1 |
-
import gradio as gr
|
|
|
2 |
|
3 |
-
css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}"
|
4 |
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
|
|
|
4 |
|
5 |
+
a = os.path.join(os.path.dirname(__file__), "files/world.mp4") # Video
|
6 |
+
b = os.path.join(os.path.dirname(__file__), "files/a.mp4") # Video
|
7 |
+
c = os.path.join(os.path.dirname(__file__), "files/b.mp4") # Video
|
8 |
|
9 |
+
|
10 |
+
demo = gr.Interface(
|
11 |
+
fn=lambda x: x,
|
12 |
+
inputs=gr.Video(type="file"),
|
13 |
+
outputs=gr.Video(),
|
14 |
+
examples=[
|
15 |
+
[a],
|
16 |
+
[b],
|
17 |
+
[c],
|
18 |
+
],
|
19 |
+
)
|
20 |
+
|
21 |
+
if __name__ == "__main__":
|
22 |
+
demo.launch()
|