Spaces:
Running
Running
umyuu
commited on
Commit
•
4b09826
1
Parent(s):
35e7d15
ノートブックに補足説明を追加しました。
Browse files- scripts/launch_app.ipynb +51 -41
- scripts/run_hot_reload.bat +1 -0
scripts/launch_app.ipynb
CHANGED
@@ -1,33 +1,22 @@
|
|
1 |
{
|
2 |
-
"nbformat": 4,
|
3 |
-
"nbformat_minor": 0,
|
4 |
-
"metadata": {
|
5 |
-
"colab": {
|
6 |
-
"provenance": []
|
7 |
-
},
|
8 |
-
"kernelspec": {
|
9 |
-
"name": "python3",
|
10 |
-
"display_name": "Python 3"
|
11 |
-
},
|
12 |
-
"language_info": {
|
13 |
-
"name": "python"
|
14 |
-
}
|
15 |
-
},
|
16 |
"cells": [
|
17 |
{
|
18 |
"cell_type": "markdown",
|
19 |
-
"source": [
|
20 |
-
"# アプリのインストール"
|
21 |
-
],
|
22 |
"metadata": {
|
23 |
"id": "QBBnZWaddxv4"
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
-
"
|
29 |
-
"%cd /content"
|
30 |
-
],
|
31 |
"metadata": {
|
32 |
"colab": {
|
33 |
"base_uri": "https://localhost:8080/"
|
@@ -35,15 +24,17 @@
|
|
35 |
"id": "7a5Rf_Qee3N1",
|
36 |
"outputId": "c3890145-930e-4889-e57e-22321250461f"
|
37 |
},
|
38 |
-
"execution_count": 1,
|
39 |
"outputs": [
|
40 |
{
|
41 |
-
"output_type": "stream",
|
42 |
"name": "stdout",
|
|
|
43 |
"text": [
|
44 |
"/content\n"
|
45 |
]
|
46 |
}
|
|
|
|
|
|
|
47 |
]
|
48 |
},
|
49 |
{
|
@@ -58,8 +49,8 @@
|
|
58 |
},
|
59 |
"outputs": [
|
60 |
{
|
61 |
-
"output_type": "stream",
|
62 |
"name": "stdout",
|
|
|
63 |
"text": [
|
64 |
"Cloning into 'SaliencyMapDemo'...\n",
|
65 |
"remote: Enumerating objects: 84, done.\u001b[K\n",
|
@@ -77,9 +68,7 @@
|
|
77 |
},
|
78 |
{
|
79 |
"cell_type": "code",
|
80 |
-
"
|
81 |
-
"%cd SaliencyMapDemo"
|
82 |
-
],
|
83 |
"metadata": {
|
84 |
"colab": {
|
85 |
"base_uri": "https://localhost:8080/"
|
@@ -87,15 +76,17 @@
|
|
87 |
"id": "H0HI3iKRenJB",
|
88 |
"outputId": "770d3024-43a2-4282-f59d-bc496cba9cf6"
|
89 |
},
|
90 |
-
"execution_count": 3,
|
91 |
"outputs": [
|
92 |
{
|
93 |
-
"output_type": "stream",
|
94 |
"name": "stdout",
|
|
|
95 |
"text": [
|
96 |
"/content/SaliencyMapDemo\n"
|
97 |
]
|
98 |
}
|
|
|
|
|
|
|
99 |
]
|
100 |
},
|
101 |
{
|
@@ -110,8 +101,8 @@
|
|
110 |
},
|
111 |
"outputs": [
|
112 |
{
|
113 |
-
"output_type": "stream",
|
114 |
"name": "stdout",
|
|
|
115 |
"text": [
|
116 |
"Collecting gradio==4.28.3 (from -r requirements.txt (line 1))\n",
|
117 |
" Downloading gradio-4.28.3-py3-none-any.whl (12.2 MB)\n",
|
@@ -269,18 +260,21 @@
|
|
269 |
},
|
270 |
{
|
271 |
"cell_type": "markdown",
|
272 |
-
"source": [
|
273 |
-
"# 実行"
|
274 |
-
],
|
275 |
"metadata": {
|
276 |
"id": "LUcp4xt2fJU9"
|
277 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
},
|
279 |
{
|
280 |
"cell_type": "code",
|
281 |
-
"
|
282 |
-
"!python app.py --share"
|
283 |
-
],
|
284 |
"metadata": {
|
285 |
"colab": {
|
286 |
"base_uri": "https://localhost:8080/"
|
@@ -288,11 +282,10 @@
|
|
288 |
"id": "J3kKmi6Rd95n",
|
289 |
"outputId": "d06135be-5c00-4b68-abba-6606f415ccce"
|
290 |
},
|
291 |
-
"execution_count": 5,
|
292 |
"outputs": [
|
293 |
{
|
294 |
-
"output_type": "stream",
|
295 |
"name": "stdout",
|
|
|
296 |
"text": [
|
297 |
"2024-05-11 12:13:31,862#アプリ起動中\n",
|
298 |
"2024-05-11 12:13:36,775#アプリ起動完了(4.912s)\n",
|
@@ -304,7 +297,24 @@
|
|
304 |
"Killing tunnel 127.0.0.1:9999 <> https://90361c40461e1540a1.gradio.live\n"
|
305 |
]
|
306 |
}
|
|
|
|
|
|
|
307 |
]
|
308 |
}
|
309 |
-
]
|
310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "markdown",
|
|
|
|
|
|
|
5 |
"metadata": {
|
6 |
"id": "QBBnZWaddxv4"
|
7 |
+
},
|
8 |
+
"source": [
|
9 |
+
"### アプリの起動 \n",
|
10 |
+
"アプリを起動するには、以下の手順を実行してください: \n",
|
11 |
+
"1. 画面上部のメニューバーの「ランタイム」をクリックしてください。 \n",
|
12 |
+
"2. ドロップダウンメニューが表示されます、「すべてのセルを実行」をクリックしてください。または、キーボードショートカットの「Ctrl+F9」を使用することもできます。 \n",
|
13 |
+
"\n",
|
14 |
+
"これにより、ノートブック内のすべてのセルが順番に実行され、アプリが起動します。 "
|
15 |
+
]
|
16 |
},
|
17 |
{
|
18 |
"cell_type": "code",
|
19 |
+
"execution_count": 1,
|
|
|
|
|
20 |
"metadata": {
|
21 |
"colab": {
|
22 |
"base_uri": "https://localhost:8080/"
|
|
|
24 |
"id": "7a5Rf_Qee3N1",
|
25 |
"outputId": "c3890145-930e-4889-e57e-22321250461f"
|
26 |
},
|
|
|
27 |
"outputs": [
|
28 |
{
|
|
|
29 |
"name": "stdout",
|
30 |
+
"output_type": "stream",
|
31 |
"text": [
|
32 |
"/content\n"
|
33 |
]
|
34 |
}
|
35 |
+
],
|
36 |
+
"source": [
|
37 |
+
"%cd /content"
|
38 |
]
|
39 |
},
|
40 |
{
|
|
|
49 |
},
|
50 |
"outputs": [
|
51 |
{
|
|
|
52 |
"name": "stdout",
|
53 |
+
"output_type": "stream",
|
54 |
"text": [
|
55 |
"Cloning into 'SaliencyMapDemo'...\n",
|
56 |
"remote: Enumerating objects: 84, done.\u001b[K\n",
|
|
|
68 |
},
|
69 |
{
|
70 |
"cell_type": "code",
|
71 |
+
"execution_count": 3,
|
|
|
|
|
72 |
"metadata": {
|
73 |
"colab": {
|
74 |
"base_uri": "https://localhost:8080/"
|
|
|
76 |
"id": "H0HI3iKRenJB",
|
77 |
"outputId": "770d3024-43a2-4282-f59d-bc496cba9cf6"
|
78 |
},
|
|
|
79 |
"outputs": [
|
80 |
{
|
|
|
81 |
"name": "stdout",
|
82 |
+
"output_type": "stream",
|
83 |
"text": [
|
84 |
"/content/SaliencyMapDemo\n"
|
85 |
]
|
86 |
}
|
87 |
+
],
|
88 |
+
"source": [
|
89 |
+
"%cd SaliencyMapDemo"
|
90 |
]
|
91 |
},
|
92 |
{
|
|
|
101 |
},
|
102 |
"outputs": [
|
103 |
{
|
|
|
104 |
"name": "stdout",
|
105 |
+
"output_type": "stream",
|
106 |
"text": [
|
107 |
"Collecting gradio==4.28.3 (from -r requirements.txt (line 1))\n",
|
108 |
" Downloading gradio-4.28.3-py3-none-any.whl (12.2 MB)\n",
|
|
|
260 |
},
|
261 |
{
|
262 |
"cell_type": "markdown",
|
|
|
|
|
|
|
263 |
"metadata": {
|
264 |
"id": "LUcp4xt2fJU9"
|
265 |
+
},
|
266 |
+
"source": [
|
267 |
+
"### 🚀 実行 \n",
|
268 |
+
"1, 「Running on public URL:」の横のリンクをクリックします。 \n",
|
269 |
+
"2, リンクをクリックすると、新しいブラウザのタブが開きアプリを自由に操作できます。 \n",
|
270 |
+
"### アプリの停止 \n",
|
271 |
+
"1,「!python app.py --share」の行の左側にある■ボタン(停止ボタン)をクリックします。 \n",
|
272 |
+
"2, アプリが停止します。 "
|
273 |
+
]
|
274 |
},
|
275 |
{
|
276 |
"cell_type": "code",
|
277 |
+
"execution_count": 5,
|
|
|
|
|
278 |
"metadata": {
|
279 |
"colab": {
|
280 |
"base_uri": "https://localhost:8080/"
|
|
|
282 |
"id": "J3kKmi6Rd95n",
|
283 |
"outputId": "d06135be-5c00-4b68-abba-6606f415ccce"
|
284 |
},
|
|
|
285 |
"outputs": [
|
286 |
{
|
|
|
287 |
"name": "stdout",
|
288 |
+
"output_type": "stream",
|
289 |
"text": [
|
290 |
"2024-05-11 12:13:31,862#アプリ起動中\n",
|
291 |
"2024-05-11 12:13:36,775#アプリ起動完了(4.912s)\n",
|
|
|
297 |
"Killing tunnel 127.0.0.1:9999 <> https://90361c40461e1540a1.gradio.live\n"
|
298 |
]
|
299 |
}
|
300 |
+
],
|
301 |
+
"source": [
|
302 |
+
"!python app.py --share"
|
303 |
]
|
304 |
}
|
305 |
+
],
|
306 |
+
"metadata": {
|
307 |
+
"colab": {
|
308 |
+
"provenance": []
|
309 |
+
},
|
310 |
+
"kernelspec": {
|
311 |
+
"display_name": "Python 3",
|
312 |
+
"name": "python3"
|
313 |
+
},
|
314 |
+
"language_info": {
|
315 |
+
"name": "python"
|
316 |
+
}
|
317 |
+
},
|
318 |
+
"nbformat": 4,
|
319 |
+
"nbformat_minor": 0
|
320 |
+
}
|
scripts/run_hot_reload.bat
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
@echo on
|
2 |
|
3 |
cd %~dp0
|
|
|
1 |
+
REM Gradioのオートリロード用のスクリプトです。
|
2 |
@echo on
|
3 |
|
4 |
cd %~dp0
|