From 1e0dd77a350e80cebedec41fd37b76c6df2a059e Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 09:29:23 +0530 Subject: [PATCH 01/11] Creating notebook to run in Colab --- colab-notebook.ipynb | 353 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 353 insertions(+) create mode 100644 colab-notebook.ipynb diff --git a/colab-notebook.ipynb b/colab-notebook.ipynb new file mode 100644 index 0000000..f5b66aa --- /dev/null +++ b/colab-notebook.ipynb @@ -0,0 +1,353 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "source": [ + "import urllib.request\n", + "import os" + ], + "metadata": { + "id": "E9JmkCtyYUVE" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = \"/content/Human-Fall-Detection/main.py\"" + ], + "metadata": { + "id": "xr1FKo8tY7dz" + }, + "execution_count": 8, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-ArdagHTXJTl", + "outputId": "f89e0de0-2535-4b2b-aa46-e823dbdbf478" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'Human-Fall-Detection'...\n", + "remote: Enumerating objects: 1377, done.\u001b[K\n", + "remote: Counting objects: 100% (134/134), done.\u001b[K\n", + "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", + "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", + "Receiving objects: 100% (1377/1377), 189.05 MiB | 35.31 MiB/s, done.\n", + "Resolving deltas: 100% (96/96), done.\n", + "Updating files: 100% (1136/1136), done.\n" + ] + } + ], + "source": [ + "!git clone https://github.com/Y-B-Class-Projects/Human-Fall-Detection.git" + ] + }, + { + "cell_type": "code", + "source": [ + "pip install -r /content/Human-Fall-Detection/requirements.txt" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "XQrRNJ5eZLir", + "outputId": "14f543ce-8667-49b3-c6d5-8e68d507d72b" + }, + "execution_count": 11, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", + "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", + "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", + "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", + "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", + "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", + "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", + "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", + "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", + "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", + "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", + "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", + "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", + "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", + "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", + "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", + " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", + "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", + " Downloading telepot-12.7.tar.gz (73 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m7.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", + " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m30.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", + "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", + "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", + "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", + "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", + "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", + "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", + "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", + "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", + "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", + "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", + "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", + "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", + "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", + "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", + "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", + " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m48.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", + "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", + "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", + "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", + "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", + "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", + "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", + "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", + "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", + "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", + "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", + "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", + "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", + "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", + "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", + "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", + "Building wheels for collected packages: telepot\n", + " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=025a808a5f1c5bcdbb4af2ce15b48bf1f0e6bcd833c690d128de3b3065c3dc03\n", + " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", + "Successfully built telepot\n", + "Installing collected packages: jedi, telepot, torchmetrics, thop\n", + "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Define the URL of the model you want to download\n", + "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" + ], + "metadata": { + "id": "KDl0FN33YVc7" + }, + "execution_count": 12, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "destination_folder = \"/content/Human-Fall-Detection\"" + ], + "metadata": { + "id": "HCvnb-7gYXeb" + }, + "execution_count": 13, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "os.makedirs(destination_folder, exist_ok=True)" + ], + "metadata": { + "id": "TiLzTHYDYbik" + }, + "execution_count": 14, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" + ], + "metadata": { + "id": "HDMUptU4Yd_b" + }, + "execution_count": 15, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "urllib.request.urlretrieve(model_url, file_path)\n", + "print(\"Model downloaded successfully!\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "JKCAcNJHYgQj", + "outputId": "3ed158e8-931f-4dd0-a631-680badd5eac0" + }, + "execution_count": 16, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model downloaded successfully!\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "if os.path.isfile(file_path):\n", + " try:\n", + " # Execute the main.py file\n", + " with open(file_path, \"r\", encoding=\"utf-8\") as file:\n", + " code = file.read()\n", + " exec(code)\n", + " except UnicodeDecodeError:\n", + " print(\"Error: Unable to decode the file as UTF-8.\")\n", + "else:\n", + " print(\"Error: main.py file not found!\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "MuFuiWvkYkAE", + "outputId": "a0af929f-b958-4fd8-b74b-3aa675343de1" + }, + "execution_count": 18, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Error: Unable to decode the file as UTF-8.\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%run /content/Human-Fall-Detection/main.py" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 469 + }, + "id": "NOF0BuroZsKM", + "outputId": "35e9d5a2-62a4-47d6-8af4-71994232a952" + }, + "execution_count": 21, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "device: cpu\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 0%| | 0/84 [00:00\u001b[0;34m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mvideo\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlistdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideos_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[0mvideo_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideos_path\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvideo\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 121\u001b[0;31m \u001b[0mprocess_video\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideo_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m/content/Human-Fall-Detection/main.py\u001b[0m in \u001b[0;36mprocess_video\u001b[0;34m(video_path)\u001b[0m\n\u001b[1;32m 104\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 105\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtqdm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_frames\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 106\u001b[0;31m \u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_pose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 107\u001b[0m \u001b[0m_image\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mprepare_image\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[0mis_fall\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbbox\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfall_detection\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/content/Human-Fall-Detection/main.py\u001b[0m in \u001b[0;36mget_pose\u001b[0;34m(image, model, device)\u001b[0m\n\u001b[1;32m 64\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mno_grad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 66\u001b[0;31m \u001b[0moutput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 67\u001b[0m output = non_max_suppression_kpt(output, 0.25, 0.65, nc=model.yaml['nc'], nkpt=model.yaml['nkpt'],\n\u001b[1;32m 68\u001b[0m kpt_label=True)\n", + "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/content/Human-Fall-Detection/models/yolo.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x, augment, profile)\u001b[0m\n\u001b[1;32m 597\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;31m# augmented inference, train.py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 598\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 599\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprofile\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# single-scale inference, train.py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 600\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 601\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprofile\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/content/Human-Fall-Detection/models/yolo.py\u001b[0m in \u001b[0;36mforward_once\u001b[0;34m(self, x, profile)\u001b[0m\n\u001b[1;32m 623\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'%10.1f%10.0f%10.1fms %-40s'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mo\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 624\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 625\u001b[0;31m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# run\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 626\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 627\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# save output\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/content/Human-Fall-Detection/models/common.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 106\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 107\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 108\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mact\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 109\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mfuseforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 461\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 462\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 463\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conv_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbias\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 464\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0;32mclass\u001b[0m \u001b[0mConv3d\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_ConvNd\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36m_conv_forward\u001b[0;34m(self, input, weight, bias)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 458\u001b[0m _pair(0), self.dilation, self.groups)\n\u001b[0;32m--> 459\u001b[0;31m return F.conv2d(input, weight, bias, self.stride,\n\u001b[0m\u001b[1;32m 460\u001b[0m self.padding, self.dilation, self.groups)\n\u001b[1;32m 461\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ] + } + ] +} \ No newline at end of file From d07c1899e0c57f8397cf0a02ff4a7d881c0a67a1 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 09:33:07 +0530 Subject: [PATCH 02/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 047c066..2fa409f 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ For the video analysis we used Nvidia's Tesla K80 GPU, the system analyzes the v - Download the [YOLOv7-POSE](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt "YOLOv7-POSE") model into `Human-Fall-Detection` directory. - Install all the requirements with `pip install -r requirements.txt` - Run main.py file + [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/colab-notebook.ipynb) ## Examples From 2643317d523c0ac2fc6d769aefc2fe6085ee2dd9 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 09:38:17 +0530 Subject: [PATCH 03/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fa409f..76063bf 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For the video analysis we used Nvidia's Tesla K80 GPU, the system analyzes the v - Download the [YOLOv7-POSE](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt "YOLOv7-POSE") model into `Human-Fall-Detection` directory. - Install all the requirements with `pip install -r requirements.txt` - Run main.py file - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/colab-notebook.ipynb) + [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]([https://colab.research.google.com/github/DevinduDh/Human-Fall-Detection/blob/main/path-to-your-notebook.ipynb](https://github.com/DevinduDh/Human-Fall-Detection/blob/master/colab-notebook.ipynb)) ## Examples From fddf9cf932d8f1f897446ad94f81661d09002924 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 09:40:35 +0530 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76063bf..9651c0b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ For the video analysis we used Nvidia's Tesla K80 GPU, the system analyzes the v - Download the [YOLOv7-POSE](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt "YOLOv7-POSE") model into `Human-Fall-Detection` directory. - Install all the requirements with `pip install -r requirements.txt` - Run main.py file - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]([https://colab.research.google.com/github/DevinduDh/Human-Fall-Detection/blob/main/path-to-your-notebook.ipynb](https://github.com/DevinduDh/Human-Fall-Detection/blob/master/colab-notebook.ipynb)) +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DevinduDh/Human-Fall-Detection/blob/master/colab-notebook.ipynb) ## Examples From afbc0291791c25a04a89cc6c20dc2575399c95d7 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 20:38:24 +0530 Subject: [PATCH 05/11] Add files via upload Adding main1.py file. This file has following changes from main.py 1. File path of dataset is made compatible with colab. 2. File path of videos is made compatible with colab. --- main1.py | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 main1.py diff --git a/main1.py b/main1.py new file mode 100644 index 0000000..7ab4e3d --- /dev/null +++ b/main1.py @@ -0,0 +1,120 @@ +import torch +import cv2 +import math +from torchvision import transforms +import numpy as np +import os + +from tqdm import tqdm + +from utils.datasets import letterbox +from utils.general import non_max_suppression_kpt +from utils.plots import output_to_keypoint, plot_skeleton_kpts + + +def fall_detection(poses): + for pose in poses: + xmin, ymin = (pose[2] - pose[4] / 2), (pose[3] - pose[5] / 2) + xmax, ymax = (pose[2] + pose[4] / 2), (pose[3] + pose[5] / 2) + left_shoulder_y = pose[23] + left_shoulder_x = pose[22] + right_shoulder_y = pose[26] + left_body_y = pose[41] + left_body_x = pose[40] + right_body_y = pose[44] + len_factor = math.sqrt(((left_shoulder_y - left_body_y) ** 2 + (left_shoulder_x - left_body_x) ** 2)) + left_foot_y = pose[53] + right_foot_y = pose[56] + dx = int(xmax) - int(xmin) + dy = int(ymax) - int(ymin) + difference = dy - dx + if left_shoulder_y > left_foot_y - len_factor and left_body_y > left_foot_y - ( + len_factor / 2) and left_shoulder_y > left_body_y - (len_factor / 2) or ( + right_shoulder_y > right_foot_y - len_factor and right_body_y > right_foot_y - ( + len_factor / 2) and right_shoulder_y > right_body_y - (len_factor / 2)) \ + or difference < 0: + return True, (xmin, ymin, xmax, ymax) + return False, None + + +def falling_alarm(image, bbox): + x_min, y_min, x_max, y_max = bbox + cv2.rectangle(image, (int(x_min), int(y_min)), (int(x_max), int(y_max)), color=(0, 0, 255), + thickness=5, lineType=cv2.LINE_AA) + cv2.putText(image, 'Person Fell down', (11, 100), 0, 1, [0, 0, 2550], thickness=3, lineType=cv2.LINE_AA) + + +def get_pose_model(): + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + print("device: ", device) + weigths = torch.load('/content/Human-Fall-Detection/yolov7-w6-pose.pt', map_location=device) + model = weigths['model'] + _ = model.float().eval() + if torch.cuda.is_available(): + model = model.half().to(device) + return model, device + + +def get_pose(image, model, device): + image = letterbox(image, 960, stride=64, auto=True)[0] + image = transforms.ToTensor()(image) + image = torch.tensor(np.array([image.numpy()])) + if torch.cuda.is_available(): + image = image.half().to(device) + with torch.no_grad(): + output, _ = model(image) + output = non_max_suppression_kpt(output, 0.25, 0.65, nc=model.yaml['nc'], nkpt=model.yaml['nkpt'], + kpt_label=True) + with torch.no_grad(): + output = output_to_keypoint(output) + return image, output + + +def prepare_image(image): + _image = image[0].permute(1, 2, 0) * 255 + _image = _image.cpu().numpy().astype(np.uint8) + _image = cv2.cvtColor(_image, cv2.COLOR_RGB2BGR) + return _image + + +def prepare_vid_out(video_path, vid_cap): + vid_write_image = letterbox(vid_cap.read()[1], 960, stride=64, auto=True)[0] + resize_height, resize_width = vid_write_image.shape[:2] + out_video_name = f"{video_path.split('/')[-1].split('.')[0]}_keypoint.mp4" + out = cv2.VideoWriter(out_video_name, cv2.VideoWriter_fourcc(*'mp4v'), 30, (resize_width, resize_height)) + return out + + +def process_video(video_path): + vid_cap = cv2.VideoCapture(video_path) + + if not vid_cap.isOpened(): + print('Error while trying to read video. Please check path again') + return + + model, device = get_pose_model() + vid_out = prepare_vid_out(video_path, vid_cap) + + success, frame = vid_cap.read() + _frames = [] + while success: + _frames.append(frame) + success, frame = vid_cap.read() + + for image in tqdm(_frames): + image, output = get_pose(image, model, device) + _image = prepare_image(image) + is_fall, bbox = fall_detection(output) + if is_fall: + falling_alarm(_image, bbox) + vid_out.write(_image) + + vid_out.release() + vid_cap.release() + + +if __name__ == '__main__': + videos_path = '/content/Human-Fall-Detection/fall_dataset/videos' + for video in os.listdir(videos_path): + video_path = os.path.join(videos_path, video) + process_video(video_path) \ No newline at end of file From 9e6e6c115670c8c38a53c92de7c2a006f73ae1b5 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 21:49:41 +0530 Subject: [PATCH 06/11] Delete colab-notebook.ipynb --- colab-notebook.ipynb | 353 ------------------------------------------- 1 file changed, 353 deletions(-) delete mode 100644 colab-notebook.ipynb diff --git a/colab-notebook.ipynb b/colab-notebook.ipynb deleted file mode 100644 index f5b66aa..0000000 --- a/colab-notebook.ipynb +++ /dev/null @@ -1,353 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "code", - "source": [ - "import urllib.request\n", - "import os" - ], - "metadata": { - "id": "E9JmkCtyYUVE" - }, - "execution_count": 2, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = \"/content/Human-Fall-Detection/main.py\"" - ], - "metadata": { - "id": "xr1FKo8tY7dz" - }, - "execution_count": 8, - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-ArdagHTXJTl", - "outputId": "f89e0de0-2535-4b2b-aa46-e823dbdbf478" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Cloning into 'Human-Fall-Detection'...\n", - "remote: Enumerating objects: 1377, done.\u001b[K\n", - "remote: Counting objects: 100% (134/134), done.\u001b[K\n", - "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", - "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", - "Receiving objects: 100% (1377/1377), 189.05 MiB | 35.31 MiB/s, done.\n", - "Resolving deltas: 100% (96/96), done.\n", - "Updating files: 100% (1136/1136), done.\n" - ] - } - ], - "source": [ - "!git clone https://github.com/Y-B-Class-Projects/Human-Fall-Detection.git" - ] - }, - { - "cell_type": "code", - "source": [ - "pip install -r /content/Human-Fall-Detection/requirements.txt" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XQrRNJ5eZLir", - "outputId": "14f543ce-8667-49b3-c6d5-8e68d507d72b" - }, - "execution_count": 11, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", - "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", - "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", - "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", - "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", - "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", - "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", - "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", - "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", - "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", - "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", - "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", - "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", - "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", - "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", - "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", - "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", - " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", - "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", - " Downloading telepot-12.7.tar.gz (73 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m7.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", - " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m30.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", - "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", - "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", - "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", - "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", - "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", - "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", - "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", - "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", - "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", - "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", - "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", - "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", - "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", - "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", - "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", - "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", - "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", - "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", - "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", - "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", - "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", - "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", - "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", - "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", - " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m48.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", - "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", - "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", - "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", - "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", - "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", - "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", - "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", - "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", - "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", - "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", - "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", - "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", - "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", - "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", - "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", - "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", - "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", - "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", - "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", - "Building wheels for collected packages: telepot\n", - " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=025a808a5f1c5bcdbb4af2ce15b48bf1f0e6bcd833c690d128de3b3065c3dc03\n", - " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", - "Successfully built telepot\n", - "Installing collected packages: jedi, telepot, torchmetrics, thop\n", - "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "# Define the URL of the model you want to download\n", - "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" - ], - "metadata": { - "id": "KDl0FN33YVc7" - }, - "execution_count": 12, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "destination_folder = \"/content/Human-Fall-Detection\"" - ], - "metadata": { - "id": "HCvnb-7gYXeb" - }, - "execution_count": 13, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "os.makedirs(destination_folder, exist_ok=True)" - ], - "metadata": { - "id": "TiLzTHYDYbik" - }, - "execution_count": 14, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" - ], - "metadata": { - "id": "HDMUptU4Yd_b" - }, - "execution_count": 15, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "urllib.request.urlretrieve(model_url, file_path)\n", - "print(\"Model downloaded successfully!\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "JKCAcNJHYgQj", - "outputId": "3ed158e8-931f-4dd0-a631-680badd5eac0" - }, - "execution_count": 16, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Model downloaded successfully!\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "if os.path.isfile(file_path):\n", - " try:\n", - " # Execute the main.py file\n", - " with open(file_path, \"r\", encoding=\"utf-8\") as file:\n", - " code = file.read()\n", - " exec(code)\n", - " except UnicodeDecodeError:\n", - " print(\"Error: Unable to decode the file as UTF-8.\")\n", - "else:\n", - " print(\"Error: main.py file not found!\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "MuFuiWvkYkAE", - "outputId": "a0af929f-b958-4fd8-b74b-3aa675343de1" - }, - "execution_count": 18, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Error: Unable to decode the file as UTF-8.\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "%run /content/Human-Fall-Detection/main.py" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 469 - }, - "id": "NOF0BuroZsKM", - "outputId": "35e9d5a2-62a4-47d6-8af4-71994232a952" - }, - "execution_count": 21, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "device: cpu\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\r 0%| | 0/84 [00:00\u001b[0;34m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mvideo\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlistdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideos_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[0mvideo_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideos_path\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvideo\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 121\u001b[0;31m \u001b[0mprocess_video\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvideo_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m/content/Human-Fall-Detection/main.py\u001b[0m in \u001b[0;36mprocess_video\u001b[0;34m(video_path)\u001b[0m\n\u001b[1;32m 104\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 105\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtqdm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_frames\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 106\u001b[0;31m \u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_pose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 107\u001b[0m \u001b[0m_image\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mprepare_image\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[0mis_fall\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbbox\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfall_detection\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/content/Human-Fall-Detection/main.py\u001b[0m in \u001b[0;36mget_pose\u001b[0;34m(image, model, device)\u001b[0m\n\u001b[1;32m 64\u001b[0m \u001b[0mimage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mimage\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhalf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mno_grad\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 66\u001b[0;31m \u001b[0moutput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 67\u001b[0m output = non_max_suppression_kpt(output, 0.25, 0.65, nc=model.yaml['nc'], nkpt=model.yaml['nkpt'],\n\u001b[1;32m 68\u001b[0m kpt_label=True)\n", - "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/content/Human-Fall-Detection/models/yolo.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x, augment, profile)\u001b[0m\n\u001b[1;32m 597\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;31m# augmented inference, train.py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 598\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 599\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprofile\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# single-scale inference, train.py\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 600\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 601\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprofile\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/content/Human-Fall-Detection/models/yolo.py\u001b[0m in \u001b[0;36mforward_once\u001b[0;34m(self, x, profile)\u001b[0m\n\u001b[1;32m 623\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'%10.1f%10.0f%10.1fms %-40s'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mo\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 624\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 625\u001b[0;31m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# run\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 626\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 627\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# save output\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/content/Human-Fall-Detection/models/common.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 106\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 107\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 108\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mact\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 109\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mfuseforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1499\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1500\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1501\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1502\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1503\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 461\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 462\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 463\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_conv_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbias\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 464\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0;32mclass\u001b[0m \u001b[0mConv3d\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_ConvNd\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/conv.py\u001b[0m in \u001b[0;36m_conv_forward\u001b[0;34m(self, input, weight, bias)\u001b[0m\n\u001b[1;32m 457\u001b[0m \u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbias\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 458\u001b[0m _pair(0), self.dilation, self.groups)\n\u001b[0;32m--> 459\u001b[0;31m return F.conv2d(input, weight, bias, self.stride,\n\u001b[0m\u001b[1;32m 460\u001b[0m self.padding, self.dilation, self.groups)\n\u001b[1;32m 461\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " - ] - } - ] - } - ] -} \ No newline at end of file From 8ee7ac898df9c51499432fa1cca9e4124a1bdb55 Mon Sep 17 00:00:00 2001 From: Devindu <3ddevindu@gmail.com> Date: Fri, 30 Jun 2023 21:50:30 +0530 Subject: [PATCH 07/11] Updated with path changes Notebook edited with new file paths compatible with Colab --- colab-notebook.ipynb | 355 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 colab-notebook.ipynb diff --git a/colab-notebook.ipynb b/colab-notebook.ipynb new file mode 100644 index 0000000..50fdb36 --- /dev/null +++ b/colab-notebook.ipynb @@ -0,0 +1,355 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "source": [ + "import urllib.request\n", + "import os" + ], + "metadata": { + "id": "E9JmkCtyYUVE" + }, + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = \"/content/Human-Fall-Detection/main.py\"" + ], + "metadata": { + "id": "xr1FKo8tY7dz" + }, + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-ArdagHTXJTl", + "outputId": "303998f8-b7d6-4d8b-87b0-3ad9c52d46bf" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'Human-Fall-Detection'...\n", + "remote: Enumerating objects: 1377, done.\u001b[K\n", + "remote: Counting objects: 100% (134/134), done.\u001b[K\n", + "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", + "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", + "Receiving objects: 100% (1377/1377), 189.05 MiB | 33.99 MiB/s, done.\n", + "Resolving deltas: 100% (96/96), done.\n", + "Updating files: 100% (1136/1136), done.\n" + ] + } + ], + "source": [ + "!git clone https://github.com/Y-B-Class-Projects/Human-Fall-Detection.git" + ] + }, + { + "cell_type": "code", + "source": [ + "pip install -r /content/Human-Fall-Detection/requirements.txt" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "XQrRNJ5eZLir", + "outputId": "23bd17e8-f87e-46c2-d9de-ab4b0d51bddd" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", + "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", + "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", + "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", + "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", + "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", + "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", + "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", + "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", + "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", + "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", + "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", + "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", + "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", + "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", + "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", + " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", + "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", + " Downloading telepot-12.7.tar.gz (73 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", + " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", + "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", + "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", + "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", + "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", + "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", + "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", + "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", + "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", + "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", + "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", + "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", + "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", + "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", + "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", + "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", + " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", + "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", + "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", + "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", + "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", + "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", + "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", + "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", + "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", + "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", + "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", + "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", + "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", + "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", + "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", + "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", + "Building wheels for collected packages: telepot\n", + " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=2576a3545e100d6db85de72942d64d96b72566cb430719ff723267db620c31e8\n", + " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", + "Successfully built telepot\n", + "Installing collected packages: jedi, telepot, torchmetrics, thop\n", + "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Define the URL of the model you want to download\n", + "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" + ], + "metadata": { + "id": "KDl0FN33YVc7" + }, + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "destination_folder = \"/content/Human-Fall-Detection\"" + ], + "metadata": { + "id": "HCvnb-7gYXeb" + }, + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "os.makedirs(destination_folder, exist_ok=True)" + ], + "metadata": { + "id": "TiLzTHYDYbik" + }, + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" + ], + "metadata": { + "id": "HDMUptU4Yd_b" + }, + "execution_count": 8, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "urllib.request.urlretrieve(model_url, file_path)\n", + "print(\"Model downloaded successfully!\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "JKCAcNJHYgQj", + "outputId": "25f4430a-a396-41f4-f286-051e5a432650" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model downloaded successfully!\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%run /content/Human-Fall-Detection/main1.py" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NOF0BuroZsKM", + "outputId": "9420894c-5c99-430d-ce58-557562743a49" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "device: cpu\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 0%| | 0/84 [00:00 Date: Sat, 1 Jul 2023 06:30:12 +0530 Subject: [PATCH 08/11] Delete colab-notebook.ipynb --- colab-notebook.ipynb | 355 ------------------------------------------- 1 file changed, 355 deletions(-) delete mode 100644 colab-notebook.ipynb diff --git a/colab-notebook.ipynb b/colab-notebook.ipynb deleted file mode 100644 index 50fdb36..0000000 --- a/colab-notebook.ipynb +++ /dev/null @@ -1,355 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "code", - "source": [ - "import urllib.request\n", - "import os" - ], - "metadata": { - "id": "E9JmkCtyYUVE" - }, - "execution_count": 1, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = \"/content/Human-Fall-Detection/main.py\"" - ], - "metadata": { - "id": "xr1FKo8tY7dz" - }, - "execution_count": 2, - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-ArdagHTXJTl", - "outputId": "303998f8-b7d6-4d8b-87b0-3ad9c52d46bf" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Cloning into 'Human-Fall-Detection'...\n", - "remote: Enumerating objects: 1377, done.\u001b[K\n", - "remote: Counting objects: 100% (134/134), done.\u001b[K\n", - "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", - "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", - "Receiving objects: 100% (1377/1377), 189.05 MiB | 33.99 MiB/s, done.\n", - "Resolving deltas: 100% (96/96), done.\n", - "Updating files: 100% (1136/1136), done.\n" - ] - } - ], - "source": [ - "!git clone https://github.com/Y-B-Class-Projects/Human-Fall-Detection.git" - ] - }, - { - "cell_type": "code", - "source": [ - "pip install -r /content/Human-Fall-Detection/requirements.txt" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XQrRNJ5eZLir", - "outputId": "23bd17e8-f87e-46c2-d9de-ab4b0d51bddd" - }, - "execution_count": 4, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", - "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", - "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", - "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", - "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", - "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", - "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", - "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", - "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", - "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", - "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", - "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", - "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", - "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", - "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", - "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", - "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", - " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", - "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", - " Downloading telepot-12.7.tar.gz (73 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", - " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", - "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", - "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", - "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", - "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", - "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", - "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", - "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", - "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", - "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", - "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", - "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", - "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", - "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", - "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", - "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", - "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", - "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", - "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", - "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", - "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", - "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", - "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", - "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", - "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", - " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", - "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", - "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", - "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", - "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", - "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", - "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", - "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", - "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", - "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", - "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", - "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", - "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", - "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", - "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", - "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", - "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", - "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", - "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", - "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", - "Building wheels for collected packages: telepot\n", - " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=2576a3545e100d6db85de72942d64d96b72566cb430719ff723267db620c31e8\n", - " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", - "Successfully built telepot\n", - "Installing collected packages: jedi, telepot, torchmetrics, thop\n", - "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "# Define the URL of the model you want to download\n", - "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" - ], - "metadata": { - "id": "KDl0FN33YVc7" - }, - "execution_count": 5, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "destination_folder = \"/content/Human-Fall-Detection\"" - ], - "metadata": { - "id": "HCvnb-7gYXeb" - }, - "execution_count": 6, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "os.makedirs(destination_folder, exist_ok=True)" - ], - "metadata": { - "id": "TiLzTHYDYbik" - }, - "execution_count": 7, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" - ], - "metadata": { - "id": "HDMUptU4Yd_b" - }, - "execution_count": 8, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "urllib.request.urlretrieve(model_url, file_path)\n", - "print(\"Model downloaded successfully!\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "JKCAcNJHYgQj", - "outputId": "25f4430a-a396-41f4-f286-051e5a432650" - }, - "execution_count": 9, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Model downloaded successfully!\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "%run /content/Human-Fall-Detection/main1.py" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "NOF0BuroZsKM", - "outputId": "9420894c-5c99-430d-ce58-557562743a49" - }, - "execution_count": 13, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "device: cpu\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\r 0%| | 0/84 [00:00 Date: Sat, 1 Jul 2023 06:30:38 +0530 Subject: [PATCH 09/11] Updated --- colab_notebook.ipynb | 355 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 colab_notebook.ipynb diff --git a/colab_notebook.ipynb b/colab_notebook.ipynb new file mode 100644 index 0000000..fe1b154 --- /dev/null +++ b/colab_notebook.ipynb @@ -0,0 +1,355 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "source": [ + "import urllib.request\n", + "import os" + ], + "metadata": { + "id": "E9JmkCtyYUVE" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = \"/content/Human-Fall-Detection/main.py\"" + ], + "metadata": { + "id": "xr1FKo8tY7dz" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-ArdagHTXJTl", + "outputId": "303998f8-b7d6-4d8b-87b0-3ad9c52d46bf" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'Human-Fall-Detection'...\n", + "remote: Enumerating objects: 1377, done.\u001b[K\n", + "remote: Counting objects: 100% (134/134), done.\u001b[K\n", + "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", + "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", + "Receiving objects: 100% (1377/1377), 189.05 MiB | 33.99 MiB/s, done.\n", + "Resolving deltas: 100% (96/96), done.\n", + "Updating files: 100% (1136/1136), done.\n" + ] + } + ], + "source": [ + "!git clone https://github.com/DevinduDh/Human-Fall-Detection.git" + ] + }, + { + "cell_type": "code", + "source": [ + "pip install -r /content/Human-Fall-Detection/requirements.txt" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "XQrRNJ5eZLir", + "outputId": "23bd17e8-f87e-46c2-d9de-ab4b0d51bddd" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", + "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", + "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", + "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", + "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", + "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", + "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", + "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", + "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", + "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", + "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", + "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", + "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", + "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", + "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", + "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", + " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", + "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", + " Downloading telepot-12.7.tar.gz (73 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", + " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", + "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", + "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", + "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", + "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", + "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", + "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", + "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", + "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", + "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", + "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", + "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", + "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", + "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", + "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", + "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", + " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", + "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", + "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", + "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", + "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", + "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", + "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", + "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", + "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", + "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", + "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", + "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", + "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", + "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", + "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", + "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", + "Building wheels for collected packages: telepot\n", + " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=2576a3545e100d6db85de72942d64d96b72566cb430719ff723267db620c31e8\n", + " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", + "Successfully built telepot\n", + "Installing collected packages: jedi, telepot, torchmetrics, thop\n", + "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Define the URL of the model you want to download\n", + "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" + ], + "metadata": { + "id": "KDl0FN33YVc7" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "destination_folder = \"/content/Human-Fall-Detection\"" + ], + "metadata": { + "id": "HCvnb-7gYXeb" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "os.makedirs(destination_folder, exist_ok=True)" + ], + "metadata": { + "id": "TiLzTHYDYbik" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" + ], + "metadata": { + "id": "HDMUptU4Yd_b" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "urllib.request.urlretrieve(model_url, file_path)\n", + "print(\"Model downloaded successfully!\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "JKCAcNJHYgQj", + "outputId": "25f4430a-a396-41f4-f286-051e5a432650" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model downloaded successfully!\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%run /content/Human-Fall-Detection/main1.py" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NOF0BuroZsKM", + "outputId": "9420894c-5c99-430d-ce58-557562743a49" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "device: cpu\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 0%| | 0/84 [00:00 Date: Sat, 1 Jul 2023 06:31:31 +0530 Subject: [PATCH 10/11] Delete colab_notebook.ipynb --- colab_notebook.ipynb | 355 ------------------------------------------- 1 file changed, 355 deletions(-) delete mode 100644 colab_notebook.ipynb diff --git a/colab_notebook.ipynb b/colab_notebook.ipynb deleted file mode 100644 index fe1b154..0000000 --- a/colab_notebook.ipynb +++ /dev/null @@ -1,355 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "code", - "source": [ - "import urllib.request\n", - "import os" - ], - "metadata": { - "id": "E9JmkCtyYUVE" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = \"/content/Human-Fall-Detection/main.py\"" - ], - "metadata": { - "id": "xr1FKo8tY7dz" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-ArdagHTXJTl", - "outputId": "303998f8-b7d6-4d8b-87b0-3ad9c52d46bf" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Cloning into 'Human-Fall-Detection'...\n", - "remote: Enumerating objects: 1377, done.\u001b[K\n", - "remote: Counting objects: 100% (134/134), done.\u001b[K\n", - "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", - "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", - "Receiving objects: 100% (1377/1377), 189.05 MiB | 33.99 MiB/s, done.\n", - "Resolving deltas: 100% (96/96), done.\n", - "Updating files: 100% (1136/1136), done.\n" - ] - } - ], - "source": [ - "!git clone https://github.com/DevinduDh/Human-Fall-Detection.git" - ] - }, - { - "cell_type": "code", - "source": [ - "pip install -r /content/Human-Fall-Detection/requirements.txt" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XQrRNJ5eZLir", - "outputId": "23bd17e8-f87e-46c2-d9de-ab4b0d51bddd" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", - "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", - "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", - "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", - "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", - "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", - "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", - "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", - "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", - "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", - "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", - "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", - "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", - "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", - "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", - "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", - "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", - " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", - "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", - " Downloading telepot-12.7.tar.gz (73 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", - " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", - "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", - "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", - "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", - "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", - "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", - "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", - "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", - "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", - "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", - "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", - "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", - "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", - "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", - "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", - "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", - "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", - "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", - "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", - "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", - "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", - "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", - "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", - "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", - "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", - "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", - " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", - "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", - "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", - "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", - "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", - "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", - "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", - "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", - "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", - "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", - "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", - "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", - "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", - "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", - "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", - "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", - "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", - "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", - "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", - "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", - "Building wheels for collected packages: telepot\n", - " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", - " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=2576a3545e100d6db85de72942d64d96b72566cb430719ff723267db620c31e8\n", - " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", - "Successfully built telepot\n", - "Installing collected packages: jedi, telepot, torchmetrics, thop\n", - "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "# Define the URL of the model you want to download\n", - "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" - ], - "metadata": { - "id": "KDl0FN33YVc7" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "destination_folder = \"/content/Human-Fall-Detection\"" - ], - "metadata": { - "id": "HCvnb-7gYXeb" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "os.makedirs(destination_folder, exist_ok=True)" - ], - "metadata": { - "id": "TiLzTHYDYbik" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" - ], - "metadata": { - "id": "HDMUptU4Yd_b" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "urllib.request.urlretrieve(model_url, file_path)\n", - "print(\"Model downloaded successfully!\")" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "JKCAcNJHYgQj", - "outputId": "25f4430a-a396-41f4-f286-051e5a432650" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Model downloaded successfully!\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "%run /content/Human-Fall-Detection/main1.py" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "NOF0BuroZsKM", - "outputId": "9420894c-5c99-430d-ce58-557562743a49" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "device: cpu\n" - ] - }, - { - "output_type": "stream", - "name": "stderr", - "text": [ - "\r 0%| | 0/84 [00:00 Date: Sat, 1 Jul 2023 06:31:45 +0530 Subject: [PATCH 11/11] Add files via upload --- colab-notebook.ipynb | 355 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 colab-notebook.ipynb diff --git a/colab-notebook.ipynb b/colab-notebook.ipynb new file mode 100644 index 0000000..fe1b154 --- /dev/null +++ b/colab-notebook.ipynb @@ -0,0 +1,355 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "code", + "source": [ + "import urllib.request\n", + "import os" + ], + "metadata": { + "id": "E9JmkCtyYUVE" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = \"/content/Human-Fall-Detection/main.py\"" + ], + "metadata": { + "id": "xr1FKo8tY7dz" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-ArdagHTXJTl", + "outputId": "303998f8-b7d6-4d8b-87b0-3ad9c52d46bf" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Cloning into 'Human-Fall-Detection'...\n", + "remote: Enumerating objects: 1377, done.\u001b[K\n", + "remote: Counting objects: 100% (134/134), done.\u001b[K\n", + "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", + "remote: Total 1377 (delta 55), reused 90 (delta 26), pack-reused 1243\u001b[K\n", + "Receiving objects: 100% (1377/1377), 189.05 MiB | 33.99 MiB/s, done.\n", + "Resolving deltas: 100% (96/96), done.\n", + "Updating files: 100% (1136/1136), done.\n" + ] + } + ], + "source": [ + "!git clone https://github.com/DevinduDh/Human-Fall-Detection.git" + ] + }, + { + "cell_type": "code", + "source": [ + "pip install -r /content/Human-Fall-Detection/requirements.txt" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "XQrRNJ5eZLir", + "outputId": "23bd17e8-f87e-46c2-d9de-ab4b0d51bddd" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Requirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.7.1)\n", + "Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 5)) (1.22.4)\n", + "Requirement already satisfied: opencv-python>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 6)) (4.7.0.72)\n", + "Requirement already satisfied: Pillow>=7.1.2 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 7)) (8.4.0)\n", + "Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 8)) (6.0)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.27.1)\n", + "Requirement already satisfied: scipy>=1.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 10)) (1.10.1)\n", + "Requirement already satisfied: torch!=1.12.0,>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.1+cu118)\n", + "Requirement already satisfied: torchvision!=0.13.0,>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 12)) (0.15.2+cu118)\n", + "Requirement already satisfied: tqdm>=4.41.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 13)) (4.65.0)\n", + "Requirement already satisfied: protobuf<4.21.3 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 14)) (3.20.3)\n", + "Requirement already satisfied: tensorboard>=2.4.1 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.12.3)\n", + "Requirement already satisfied: pandas>=1.1.4 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 21)) (1.5.3)\n", + "Requirement already satisfied: seaborn>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 22)) (0.12.2)\n", + "Requirement already satisfied: ipython in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 34)) (7.34.0)\n", + "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r /content/Human-Fall-Detection/requirements.txt (line 35)) (5.9.5)\n", + "Collecting thop~=0.1.1.post2209072238 (from -r /content/Human-Fall-Detection/requirements.txt (line 36))\n", + " Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", + "Collecting telepot~=12.7 (from -r /content/Human-Fall-Detection/requirements.txt (line 41))\n", + " Downloading telepot-12.7.tar.gz (73 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.1/73.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "Collecting torchmetrics~=0.10.2 (from -r /content/Human-Fall-Detection/requirements.txt (line 42))\n", + " Downloading torchmetrics-0.10.3-py3-none-any.whl (529 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m529.7/529.7 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.1.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (0.11.0)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (4.40.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (1.4.4)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (23.1)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (3.1.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->-r /content/Human-Fall-Detection/requirements.txt (line 4)) (2.8.2)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (1.26.16)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2023.5.7)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (2.0.12)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->-r /content/Human-Fall-Detection/requirements.txt (line 9)) (3.4)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.12.2)\n", + "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (4.6.3)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.11.1)\n", + "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1)\n", + "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.1.2)\n", + "Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (2.0.0)\n", + "Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (3.25.2)\n", + "Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (16.0.6)\n", + "Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.4.0)\n", + "Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.56.0)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.17.3)\n", + "Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.0.0)\n", + "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.4.3)\n", + "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (67.7.2)\n", + "Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.7.1)\n", + "Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.3.6)\n", + "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.40.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.1.4->-r /content/Human-Fall-Detection/requirements.txt (line 21)) (2022.7.1)\n", + "Collecting jedi>=0.16 (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34))\n", + " Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.4.2)\n", + "Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.5)\n", + "Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (5.7.1)\n", + "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (3.0.38)\n", + "Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (2.14.0)\n", + "Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.0)\n", + "Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.1.6)\n", + "Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (4.8.0)\n", + "Requirement already satisfied: aiohttp>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (3.8.4)\n", + "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (23.1.0)\n", + "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (6.0.4)\n", + "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (4.0.2)\n", + "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.9.2)\n", + "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.3)\n", + "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp>=3.0.0->telepot~=12.7->-r /content/Human-Fall-Detection/requirements.txt (line 41)) (1.3.1)\n", + "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (5.3.1)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.3.0)\n", + "Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.16.0)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (4.9)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (1.3.1)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.8.3)\n", + "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.7.0)\n", + "Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->-r /content/Human-Fall-Detection/requirements.txt (line 34)) (0.2.6)\n", + "Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from werkzeug>=1.0.1->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (2.1.3)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch!=1.12.0,>=1.7.0->-r /content/Human-Fall-Detection/requirements.txt (line 11)) (1.3.0)\n", + "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (0.5.0)\n", + "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.4.1->-r /content/Human-Fall-Detection/requirements.txt (line 17)) (3.2.2)\n", + "Building wheels for collected packages: telepot\n", + " Building wheel for telepot (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + " Created wheel for telepot: filename=telepot-12.7-py3-none-any.whl size=57944 sha256=2576a3545e100d6db85de72942d64d96b72566cb430719ff723267db620c31e8\n", + " Stored in directory: /root/.cache/pip/wheels/9f/9a/92/2e34a093e40a09338847e54dc9fcaab4ce01a59ba17c784c6c\n", + "Successfully built telepot\n", + "Installing collected packages: jedi, telepot, torchmetrics, thop\n", + "Successfully installed jedi-0.18.2 telepot-12.7 thop-0.1.1.post2209072238 torchmetrics-0.10.3\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Define the URL of the model you want to download\n", + "model_url = \"https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt\"" + ], + "metadata": { + "id": "KDl0FN33YVc7" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "destination_folder = \"/content/Human-Fall-Detection\"" + ], + "metadata": { + "id": "HCvnb-7gYXeb" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "os.makedirs(destination_folder, exist_ok=True)" + ], + "metadata": { + "id": "TiLzTHYDYbik" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "file_path = os.path.join(destination_folder, \"yolov7-w6-pose.pt\")" + ], + "metadata": { + "id": "HDMUptU4Yd_b" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "urllib.request.urlretrieve(model_url, file_path)\n", + "print(\"Model downloaded successfully!\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "JKCAcNJHYgQj", + "outputId": "25f4430a-a396-41f4-f286-051e5a432650" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Model downloaded successfully!\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%run /content/Human-Fall-Detection/main1.py" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NOF0BuroZsKM", + "outputId": "9420894c-5c99-430d-ce58-557562743a49" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "device: cpu\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "\r 0%| | 0/84 [00:00