{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "toc_visible": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "source": [ "# アプリのインストール" ], "metadata": { "id": "QBBnZWaddxv4" } }, { "cell_type": "code", "source": [ "%cd /content" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "7a5Rf_Qee3N1", "outputId": "719bb077-fd14-4761-fb37-ad2aa86c17d8" }, "execution_count": 35, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content\n" ] } ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "fYM7KJOfdPuK", "outputId": "31d665dc-e159-4e2c-f1a2-05a6a6a39ea0" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "fatal: destination path 'SaliencyMapDemo' already exists and is not an empty directory.\n" ] } ], "source": [ "!git clone https://github.com/umyuu/SaliencyMapDemo.git" ] }, { "cell_type": "code", "source": [ "%cd SaliencyMapDemo" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "H0HI3iKRenJB", "outputId": "67e4274d-cb65-4f75-b1ae-e79a6fe953a2" }, "execution_count": 40, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/SaliencyMapDemo/SaliencyMapDemo\n" ] } ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "UxrRgQpmDK_g", "outputId": "ff72156f-9b3e-42ed-9b21-95de1d83ad2a" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: aiofiles==23.2.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 1)) (23.2.1)\n", "Requirement already satisfied: altair==5.3.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (5.3.0)\n", "Requirement already satisfied: annotated-types==0.6.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 3)) (0.6.0)\n", "Requirement already satisfied: anyio==4.3.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 4)) (4.3.0)\n", "Requirement already satisfied: attrs==23.2.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 5)) (23.2.0)\n", "Requirement already satisfied: certifi==2024.2.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 6)) (2024.2.2)\n", "Requirement already satisfied: charset-normalizer==3.3.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (3.3.2)\n", "Requirement already satisfied: click==8.1.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 8)) (8.1.7)\n", "Requirement already satisfied: colorama==0.4.6 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 9)) (0.4.6)\n", "Requirement already satisfied: contourpy==1.2.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 10)) (1.2.1)\n", "Requirement already satisfied: cycler==0.12.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 11)) (0.12.1)\n", "Requirement already satisfied: dnspython==2.6.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 12)) (2.6.1)\n", "Requirement already satisfied: email_validator==2.1.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 13)) (2.1.1)\n", "Requirement already satisfied: exceptiongroup==1.2.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 14)) (1.2.1)\n", "Requirement already satisfied: fastapi==0.111.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 15)) (0.111.0)\n", "Requirement already satisfied: fastapi-cli==0.0.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 16)) (0.0.2)\n", "Requirement already satisfied: ffmpy==0.3.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 17)) (0.3.2)\n", "Requirement already satisfied: filelock==3.14.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 18)) (3.14.0)\n", "Requirement already satisfied: fonttools==4.51.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 19)) (4.51.0)\n", "Requirement already satisfied: fsspec==2024.3.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 20)) (2024.3.1)\n", "Requirement already satisfied: gradio==4.28.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 21)) (4.28.3)\n", "Requirement already satisfied: gradio_client==0.16.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 22)) (0.16.0)\n", "Requirement already satisfied: h11==0.14.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 23)) (0.14.0)\n", "Requirement already satisfied: httpcore==1.0.5 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 24)) (1.0.5)\n", "Requirement already satisfied: httptools==0.6.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 25)) (0.6.1)\n", "Requirement already satisfied: httpx==0.27.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 26)) (0.27.0)\n", "Requirement already satisfied: huggingface-hub==0.23.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 27)) (0.23.0)\n", "Requirement already satisfied: idna==3.7 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 28)) (3.7)\n", "Requirement already satisfied: importlib_resources==6.4.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 29)) (6.4.0)\n", "Requirement already satisfied: Jinja2==3.1.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 30)) (3.1.3)\n", "Requirement already satisfied: jsonschema==4.22.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 31)) (4.22.0)\n", "Requirement already satisfied: jsonschema-specifications==2023.12.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 32)) (2023.12.1)\n", "Requirement already satisfied: kiwisolver==1.4.5 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 33)) (1.4.5)\n", "Requirement already satisfied: markdown-it-py==3.0.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 34)) (3.0.0)\n", "Requirement already satisfied: MarkupSafe==2.1.5 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 35)) (2.1.5)\n", "Requirement already satisfied: matplotlib==3.8.4 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 36)) (3.8.4)\n", "Requirement already satisfied: mdurl==0.1.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 37)) (0.1.2)\n", "Requirement already satisfied: numpy==1.26.4 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 38)) (1.26.4)\n", "Requirement already satisfied: opencv-python==4.9.0.80 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 39)) (4.9.0.80)\n", "Requirement already satisfied: opencv-contrib-python==4.9.0.80 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 40)) (4.9.0.80)\n", "Requirement already satisfied: orjson==3.10.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 41)) (3.10.2)\n", "Requirement already satisfied: packaging==24.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 42)) (24.0)\n", "Requirement already satisfied: pandas==2.2.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 43)) (2.2.2)\n", "Requirement already satisfied: pillow==10.3.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 44)) (10.3.0)\n", "Requirement already satisfied: pydantic==2.7.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 45)) (2.7.1)\n", "Requirement already satisfied: pydantic_core==2.18.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 46)) (2.18.2)\n", "Requirement already satisfied: pydub==0.25.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 47)) (0.25.1)\n", "Requirement already satisfied: Pygments==2.17.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 48)) (2.17.2)\n", "Requirement already satisfied: pyparsing==3.1.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 49)) (3.1.2)\n", "Requirement already satisfied: python-dateutil==2.9.0.post0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 50)) (2.9.0.post0)\n", "Requirement already satisfied: python-dotenv==1.0.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 51)) (1.0.1)\n", "Requirement already satisfied: python-multipart==0.0.9 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 52)) (0.0.9)\n", "Requirement already satisfied: pytz==2024.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 53)) (2024.1)\n", "Requirement already satisfied: PyYAML==6.0.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 54)) (6.0.1)\n", "Requirement already satisfied: referencing==0.35.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 55)) (0.35.1)\n", "Requirement already satisfied: requests==2.31.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 56)) (2.31.0)\n", "Requirement already satisfied: rich==13.7.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 57)) (13.7.1)\n", "Requirement already satisfied: rpds-py==0.18.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 58)) (0.18.0)\n", "Requirement already satisfied: ruff==0.4.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 59)) (0.4.2)\n", "Requirement already satisfied: semantic-version==2.10.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 60)) (2.10.0)\n", "Requirement already satisfied: shellingham==1.5.4 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 61)) (1.5.4)\n", "Requirement already satisfied: six==1.16.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 62)) (1.16.0)\n", "Requirement already satisfied: sniffio==1.3.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 63)) (1.3.1)\n", "Requirement already satisfied: starlette==0.37.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 64)) (0.37.2)\n", "Requirement already satisfied: tomlkit==0.12.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 65)) (0.12.0)\n", "Requirement already satisfied: toolz==0.12.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 66)) (0.12.1)\n", "Requirement already satisfied: tqdm==4.66.4 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 67)) (4.66.4)\n", "Requirement already satisfied: typer==0.12.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 68)) (0.12.3)\n", "Requirement already satisfied: typing_extensions==4.11.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 69)) (4.11.0)\n", "Requirement already satisfied: tzdata==2024.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 70)) (2024.1)\n", "Requirement already satisfied: ujson==5.9.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 71)) (5.9.0)\n", "Requirement already satisfied: urllib3==2.2.1 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 72)) (2.2.1)\n", "Requirement already satisfied: uvicorn==0.29.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 73)) (0.29.0)\n", "Requirement already satisfied: watchfiles==0.21.0 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 74)) (0.21.0)\n", "Requirement already satisfied: websockets==11.0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 75)) (11.0.3)\n", "Requirement already satisfied: uvloop!=0.15.0,!=0.15.1,>=0.14.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn==0.29.0->-r requirements.txt (line 73)) (0.19.0)\n" ] } ], "source": [ "!pip install -r requirements.txt" ] }, { "cell_type": "markdown", "source": [ "# 実行" ], "metadata": { "id": "LUcp4xt2fJU9" } }, { "cell_type": "code", "source": [ "!python app.py --share True" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "J3kKmi6Rd95n", "outputId": "f6d09c36-8603-4ff6-fb34-f72497dcc0ff" }, "execution_count": 39, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Traceback (most recent call last):\n", " File \"/content/SaliencyMapDemo/app.py\", line 12, in \n", " import utils\n", "ModuleNotFoundError: No module named 'utils'\n" ] } ] } ] }