test
Browse files
app.ipynb
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "code",
|
5 |
-
"execution_count": null,
|
6 |
-
"metadata": {},
|
7 |
-
"outputs": [],
|
8 |
-
"source": [
|
9 |
-
"import gradio as gr\n",
|
10 |
-
"\n",
|
11 |
-
"def greet(name):\n",
|
12 |
-
" return \"Hello \" + name + \"!\"\n",
|
13 |
-
"\n",
|
14 |
-
"demo = gr.Interface(fn=greet, inputs=\"text\", outputs=\"text\")\n",
|
15 |
-
"demo.launch() "
|
16 |
-
]
|
17 |
-
}
|
18 |
-
],
|
19 |
-
"metadata": {
|
20 |
-
"language_info": {
|
21 |
-
"name": "python"
|
22 |
-
}
|
23 |
-
},
|
24 |
-
"nbformat": 4,
|
25 |
-
"nbformat_minor": 2
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!"
|
5 |
+
|
6 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
opencv-python
|
2 |
+
huggingface_hub
|
3 |
+
ultralytics
|
4 |
+
supervision
|
test.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
%pip install -r requirements.txt
|
2 |
+
%pip install gradio
|
3 |
+
|
4 |
+
import gradio as gr
|
5 |
+
import numpy as np
|
6 |
+
|
7 |
+
def sepia(input_img):
|
8 |
+
sepia_filter - np.array([
|
9 |
+
[0.393, 0.769, 0.189],
|
10 |
+
[0.349, 0.686, 0.168],
|
11 |
+
[0.272, 0.534, 0.131]
|
12 |
+
])
|
13 |
+
sepia_img = input_img.dot(sepia_filter.T)
|
14 |
+
sepia_img /= sepia_img.max()
|
15 |
+
return sepia_img
|
16 |
+
|
17 |
+
demo = gr.Interface(sepia, gr.Image(), "Image")
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
demo.launch()
|
21 |
+
|