Update index.html
Browse files- index.html +32 -51
index.html
CHANGED
@@ -1,57 +1,38 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
}
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
def process(input_image):
|
28 |
-
output_image = as_gray(input_image)
|
29 |
-
return output_image
|
30 |
-
|
31 |
-
demo = gr.Interface(
|
32 |
-
process,
|
33 |
-
"image",
|
34 |
-
"image",
|
35 |
-
examples=["lion.jpg", "logo.png"],
|
36 |
-
)
|
37 |
-
|
38 |
-
demo.launch()
|
39 |
-
</gradio-file>
|
40 |
-
|
41 |
-
<gradio-file name="filters.py">
|
42 |
-
from skimage.color import rgb2gray
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
|
|
50 |
|
51 |
-
|
52 |
-
# Same syntax as requirements.txt
|
53 |
-
scikit-image
|
54 |
-
</gradio-requirements>
|
55 |
-
</gradio-lite>
|
56 |
-
</body>
|
57 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Gradio Lite Demo</title>
|
6 |
+
<script src="https://cdn.jsdelivr.net/npm/@gradio/gradio-lite@latest"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
|
10 |
+
<div id="gradio-app"></div>
|
11 |
+
|
12 |
+
<script>
|
13 |
+
const config = {
|
14 |
+
"fn": "hello_world", // Название функции, которая будет вызываться
|
15 |
+
"inputs": [
|
16 |
+
{
|
17 |
+
"type": "text", // Тип входного поля
|
18 |
+
"label": "Input Text" // Метка для входного поля
|
19 |
}
|
20 |
+
],
|
21 |
+
"outputs": [
|
22 |
+
{
|
23 |
+
"type": "text", // Тип выходного поля
|
24 |
+
"label": "Output Text" // Метка для выходного поля
|
25 |
+
}
|
26 |
+
]
|
27 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
function hello_world(input_text) {
|
30 |
+
return `Hello, ${input_text}!`;
|
31 |
+
}
|
32 |
|
33 |
+
gradioApp = new GradioApp(config, {hello_world});
|
34 |
+
gradioApp.run(document.querySelector("#gradio-app"));
|
35 |
+
</script>
|
36 |
|
37 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
38 |
</html>
|