roundabout,
created on Sunday, 26 May 2024, 17:44:47 (1716745487),
received on Sunday, 26 May 2024, 17:45:09 (1716745509)
Author identity: vlad <vlad.muntoiu@gmail.com>
7d732a64f3341506d5b8250ef62944640726a73f
COPYING.md
@@ -59,6 +59,8 @@ The images in the repository are licensed depending on their source:
* If the file name has the `dwc` prefix, it comes from https://www.kaggle.com/datasets/arkadiyhacks/drinking-waste-classification and is in the public domain. * If the file name has the `sushi` prefix, it comes from https://github.com/arthur-cen/smartTrashBin/tree/master/data. > © 2021 Arthur Cen, [Attribution Share-Alike 4.0](https://creativecommons.org/licenses/by-sa/4.0/). * If the file name has the `odpadky` prefix, it comes from https://www.kaggle.com/datasets/ackobecko/odpadky. > © 2023 AdaMb, [Attribution Share-Alike 4.0](https://creativecommons.org/licenses/by-sa/4.0/).The VIA application shipped in this repository (located at the `/via` path) is licensed under the BSD licence. > Copyright (c) 2016-2021, Abhishek Dutta, Visual Geometry Group, Oxford University and VIA Contributors.
main.ipynb
@@ -34,66 +34,66 @@
"Defaulting to user installation because normal site-packages is not writeable\n", "Collecting torchvision\n", " Downloading torchvision-0.18.0-cp310-cp310-manylinux1_x86_64.whl (7.0 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.0/7.0 MB\u001b[0m \u001b[31m9.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m0m eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/lib/python3/dist-packages (from torchvision) (9.0.1)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m7.0/7.0 MB\u001B[0m \u001B[31m9.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m0m eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/lib/python3/dist-packages (from torchvision) (9.0.1)\n","Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from torchvision) (1.21.5)\n", "Collecting torch==2.3.0\n", " Downloading torch-2.3.0-cp310-cp310-manylinux1_x86_64.whl (779.1 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m779.1/779.1 MB\u001b[0m \u001b[31m1.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:07\u001b[0m\n","\u001b[?25hCollecting nvidia-cufft-cu12==11.0.2.54\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m779.1/779.1 MB\u001B[0m \u001B[31m1.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:07\u001B[0m\n", "\u001B[?25hCollecting nvidia-cufft-cu12==11.0.2.54\n"," Downloading nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.6/121.6 MB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting nvidia-curand-cu12==10.3.2.106\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m121.6/121.6 MB\u001B[0m \u001B[31m6.8 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting nvidia-curand-cu12==10.3.2.106\n"," Downloading nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.5/56.5 MB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting nvidia-cusparse-cu12==12.1.0.106\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m56.5/56.5 MB\u001B[0m \u001B[31m4.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting nvidia-cusparse-cu12==12.1.0.106\n"," Downloading nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.0/196.0 MB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: filelock in /usr/lib/python3/dist-packages (from torch==2.3.0->torchvision) (3.6.0)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m196.0/196.0 MB\u001B[0m \u001B[31m4.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: filelock in /usr/lib/python3/dist-packages (from torch==2.3.0->torchvision) (3.6.0)\n","Collecting nvidia-cublas-cu12==12.1.3.1\n", " Downloading nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m410.6/410.6 MB\u001b[0m \u001b[31m4.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:02\u001b[0m\n","\u001b[?25hCollecting nvidia-cuda-cupti-cu12==12.1.105\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m410.6/410.6 MB\u001B[0m \u001B[31m4.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:02\u001B[0m\n", "\u001B[?25hCollecting nvidia-cuda-cupti-cu12==12.1.105\n"," Downloading nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m14.1/14.1 MB\u001b[0m \u001b[31m5.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting nvidia-cusolver-cu12==11.4.5.107\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m14.1/14.1 MB\u001B[0m \u001B[31m5.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting nvidia-cusolver-cu12==11.4.5.107\n"," Downloading nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m124.2/124.2 MB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting nvidia-nccl-cu12==2.20.5\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m124.2/124.2 MB\u001B[0m \u001B[31m7.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting nvidia-nccl-cu12==2.20.5\n"," Downloading nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl (176.2 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m176.2/176.2 MB\u001b[0m \u001b[31m6.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: sympy in /usr/lib/python3/dist-packages (from torch==2.3.0->torchvision) (1.9)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m176.2/176.2 MB\u001B[0m \u001B[31m6.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: sympy in /usr/lib/python3/dist-packages (from torch==2.3.0->torchvision) (1.9)\n","Collecting networkx\n", " Downloading networkx-3.3-py3-none-any.whl (1.7 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m[31m9.7 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0mm\n","\u001b[?25hCollecting nvidia-cuda-nvrtc-cu12==12.1.105\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m1.7/1.7 MB\u001B[0m \u001B[31m8.8 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m[31m9.7 MB/s\u001B[0m eta \u001B[36m0:00:01\u001B[0mm\n", "\u001B[?25hCollecting nvidia-cuda-nvrtc-cu12==12.1.105\n"," Downloading nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m23.7/23.7 MB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m0m eta \u001b[36m0:00:01\u001b[0m0:01\u001b[0m:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: jinja2 in /home/tudov/.local/lib/python3.10/site-packages (from torch==2.3.0->torchvision) (3.1.4)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m23.7/23.7 MB\u001B[0m \u001B[31m9.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m0m eta \u001B[36m0:00:01\u001B[0m0:01\u001B[0m:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: jinja2 in /home/tudov/.local/lib/python3.10/site-packages (from torch==2.3.0->torchvision) (3.1.4)\n","Collecting fsspec\n", " Downloading fsspec-2024.5.0-py3-none-any.whl (316 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m316.1/316.1 KB\u001b[0m \u001b[31m10.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting nvidia-cudnn-cu12==8.9.2.26\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m316.1/316.1 KB\u001B[0m \u001B[31m10.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", "\u001B[?25hCollecting nvidia-cudnn-cu12==8.9.2.26\n"," Downloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m731.7/731.7 MB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:02\u001b[0m\n","\u001b[?25hCollecting nvidia-cuda-runtime-cu12==12.1.105\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m731.7/731.7 MB\u001B[0m \u001B[31m5.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:02\u001B[0m\n", "\u001B[?25hCollecting nvidia-cuda-runtime-cu12==12.1.105\n"," Downloading nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m823.6/823.6 KB\u001b[0m \u001b[31m11.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m0:01\u001b[0m\n","\u001b[?25hCollecting triton==2.3.0\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m823.6/823.6 KB\u001B[0m \u001B[31m11.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m0:01\u001B[0m\n", "\u001B[?25hCollecting triton==2.3.0\n"," Downloading triton-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (168.1 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m168.1/168.1 MB\u001b[0m \u001b[31m10.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting nvidia-nvtx-cu12==12.1.105\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m168.1/168.1 MB\u001B[0m \u001B[31m10.4 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting nvidia-nvtx-cu12==12.1.105\n"," Downloading nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m99.1/99.1 KB\u001b[0m \u001b[31m10.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: typing-extensions>=4.8.0 in /home/tudov/.local/lib/python3.10/site-packages (from torch==2.3.0->torchvision) (4.12.0)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m99.1/99.1 KB\u001B[0m \u001B[31m10.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", "\u001B[?25hRequirement already satisfied: typing-extensions>=4.8.0 in /home/tudov/.local/lib/python3.10/site-packages (from torch==2.3.0->torchvision) (4.12.0)\n","Collecting nvidia-nvjitlink-cu12\n", " Downloading nvidia_nvjitlink_cu12-12.5.40-py3-none-manylinux2014_x86_64.whl (21.3 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.3/21.3 MB\u001b[0m \u001b[31m13.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3/dist-packages (from jinja2->torch==2.3.0->torchvision) (2.0.1)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m21.3/21.3 MB\u001B[0m \u001B[31m13.4 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3/dist-packages (from jinja2->torch==2.3.0->torchvision) (2.0.1)\n","Installing collected packages: triton, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, networkx, fsspec, nvidia-cusparse-cu12, nvidia-cudnn-cu12, nvidia-cusolver-cu12, torch, torchvision\n", "\u001b[33m WARNING: The scripts convert-caffe2-to-onnx, convert-onnx-to-caffe2 and torchrun are installed in '/home/tudov/.local/bin' which is not on PATH.\n"," Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n","\u001b[0mSuccessfully installed fsspec-2024.5.0 networkx-3.3 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.5.40 nvidia-nvtx-cu12-12.1.105 torch-2.3.0 torchvision-0.18.0 triton-2.3.0\n","\u001B[33m WARNING: The scripts convert-caffe2-to-onnx, convert-onnx-to-caffe2 and torchrun are installed in '/home/tudov/.local/bin' which is not on PATH.\n", " Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001B[0m\u001B[33m\n", "\u001B[0mSuccessfully installed fsspec-2024.5.0 networkx-3.3 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.5.40 nvidia-nvtx-cu12-12.1.105 torch-2.3.0 torchvision-0.18.0 triton-2.3.0\n","Note: you may need to restart the kernel to use updated packages.\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: torch in /home/tudov/.local/lib/python3.10/site-packages (2.3.0)\n",
@@ -124,23 +124,23 @@
"Defaulting to user installation because normal site-packages is not writeable\n", "Collecting ultralytics\n", " Downloading ultralytics-8.2.22-py3-none-any.whl (778 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m778.4/778.4 KB\u001b[0m \u001b[31m4.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: requests>=2.23.0 in /home/tudov/.local/lib/python3.10/site-packages (from ultralytics) (2.32.2)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m778.4/778.4 KB\u001B[0m \u001B[31m4.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m MB/s\u001B[0m eta \u001B[36m0:00:01\u001B[0m:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: requests>=2.23.0 in /home/tudov/.local/lib/python3.10/site-packages (from ultralytics) (2.32.2)\n","Requirement already satisfied: scipy>=1.4.1 in /usr/lib/python3/dist-packages (from ultralytics) (1.8.0)\n", "Requirement already satisfied: torch>=1.8.0 in /home/tudov/.local/lib/python3.10/site-packages (from ultralytics) (2.3.0)\n", "Collecting seaborn>=0.11.0\n", " Downloading seaborn-0.13.2-py3-none-any.whl (294 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m294.9/294.9 KB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m31m10.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: pyyaml>=5.3.1 in /usr/lib/python3/dist-packages (from ultralytics) (5.4.1)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m294.9/294.9 KB\u001B[0m \u001B[31m7.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m31m10.3 MB/s\u001B[0m eta \u001B[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: pyyaml>=5.3.1 in /usr/lib/python3/dist-packages (from ultralytics) (5.4.1)\n","Collecting pandas>=1.1.4\n", " Downloading pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.0/13.0 MB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0mm\n","\u001b[?25hCollecting py-cpuinfo\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m13.0/13.0 MB\u001B[0m \u001B[31m7.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0mm\n", "\u001B[?25hCollecting py-cpuinfo\n"," Downloading py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)\n", "Collecting tqdm>=4.64.0\n", " Downloading tqdm-4.66.4-py3-none-any.whl (78 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.3/78.3 KB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: pillow>=7.1.2 in /usr/lib/python3/dist-packages (from ultralytics) (9.0.1)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m78.3/78.3 KB\u001B[0m \u001B[31m4.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", "\u001B[?25hRequirement already satisfied: pillow>=7.1.2 in /usr/lib/python3/dist-packages (from ultralytics) (9.0.1)\n","Requirement already satisfied: psutil in /usr/lib/python3/dist-packages (from ultralytics) (5.9.0)\n", "Requirement already satisfied: torchvision>=0.9.0 in /home/tudov/.local/lib/python3.10/site-packages (from ultralytics) (0.18.0)\n", "Requirement already satisfied: matplotlib>=3.3.0 in /usr/lib/python3/dist-packages (from ultralytics) (3.5.1)\n",
@@ -148,15 +148,15 @@
" Downloading thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)\n", "Collecting opencv-python>=4.6.0\n", " Downloading opencv_python-4.9.0.80-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.2 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.2/62.2 MB\u001b[0m \u001b[31m13.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: numpy>=1.21.2 in /usr/lib/python3/dist-packages (from opencv-python>=4.6.0->ultralytics) (1.21.5)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m62.2/62.2 MB\u001B[0m \u001B[31m13.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: numpy>=1.21.2 in /usr/lib/python3/dist-packages (from opencv-python>=4.6.0->ultralytics) (1.21.5)\n","Collecting tzdata>=2022.7\n", " Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m345.4/345.4 KB\u001b[0m \u001b[31m10.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting numpy>=1.21.2\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m345.4/345.4 KB\u001B[0m \u001B[31m10.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n", "\u001B[?25hCollecting numpy>=1.21.2\n"," Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m18.2/18.2 MB\u001b[0m \u001b[31m12.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hRequirement already satisfied: python-dateutil>=2.8.2 in /home/tudov/.local/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics) (2.9.0.post0)\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m18.2/18.2 MB\u001B[0m \u001B[31m12.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hRequirement already satisfied: python-dateutil>=2.8.2 in /home/tudov/.local/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics) (2.9.0.post0)\n","Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas>=1.1.4->ultralytics) (2022.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.23.0->ultralytics) (3.3)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /home/tudov/.local/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics) (3.3.2)\n",
@@ -184,31 +184,31 @@
"Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas>=1.1.4->ultralytics) (1.16.0)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3/dist-packages (from jinja2->torch>=1.8.0->ultralytics) (2.0.1)\n", "Installing collected packages: py-cpuinfo, tzdata, tqdm, numpy, pandas, opencv-python, seaborn, thop, ultralytics\n", "\u001b[33m WARNING: The script cpuinfo is installed in '/home/tudov/.local/bin' which is not on PATH.\n"," Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n","\u001b[0m\u001b[33m WARNING: The script tqdm is installed in '/home/tudov/.local/bin' which is not on PATH.\n"," Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n","\u001b[0m\u001b[33m WARNING: The script f2py is installed in '/home/tudov/.local/bin' which is not on PATH.\n"," Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n","\u001b[0m\u001b[33m WARNING: The scripts ultralytics and yolo are installed in '/home/tudov/.local/bin' which is not on PATH.\n"," Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n","\u001b[0mSuccessfully installed numpy-1.26.4 opencv-python-4.9.0.80 pandas-2.2.2 py-cpuinfo-9.0.0 seaborn-0.13.2 thop-0.1.1.post2209072238 tqdm-4.66.4 tzdata-2024.1 ultralytics-8.2.22\n","\u001B[33m WARNING: The script cpuinfo is installed in '/home/tudov/.local/bin' which is not on PATH.\n", " Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001B[0m\u001B[33m\n", "\u001B[0m\u001B[33m WARNING: The script tqdm is installed in '/home/tudov/.local/bin' which is not on PATH.\n", " Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001B[0m\u001B[33m\n", "\u001B[0m\u001B[33m WARNING: The script f2py is installed in '/home/tudov/.local/bin' which is not on PATH.\n", " Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001B[0m\u001B[33m\n", "\u001B[0m\u001B[33m WARNING: The scripts ultralytics and yolo are installed in '/home/tudov/.local/bin' which is not on PATH.\n", " Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001B[0m\u001B[33m\n", "\u001B[0mSuccessfully installed numpy-1.26.4 opencv-python-4.9.0.80 pandas-2.2.2 py-cpuinfo-9.0.0 seaborn-0.13.2 thop-0.1.1.post2209072238 tqdm-4.66.4 tzdata-2024.1 ultralytics-8.2.22\n","Note: you may need to restart the kernel to use updated packages.\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Collecting pillow_heif\n", " Downloading pillow_heif-0.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.5/7.5 MB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m0:01\u001b[0m:01\u001b[0mm\n","\u001b[?25hCollecting pillow>=9.5.0\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m7.5/7.5 MB\u001B[0m \u001B[31m7.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m0:01\u001B[0m:01\u001B[0mm\n", "\u001B[?25hCollecting pillow>=9.5.0\n"," Downloading pillow-10.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (4.5 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.5/4.5 MB\u001b[0m \u001b[31m3.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hInstalling collected packages: pillow, pillow_heif\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m4.5/4.5 MB\u001B[0m \u001B[31m3.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hInstalling collected packages: pillow, pillow_heif\n","Successfully installed pillow-10.3.0 pillow_heif-0.16.0\n", "Note: you may need to restart the kernel to use updated packages.\n", "Defaulting to user installation because normal site-packages is not writeable\n", "Collecting plotly\n", " Downloading plotly-5.22.0-py3-none-any.whl (16.4 MB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m16.4/16.4 MB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting tenacity>=6.2.0\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m16.4/16.4 MB\u001B[0m \u001B[31m5.0 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0mm eta \u001B[36m0:00:01\u001B[0m[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting tenacity>=6.2.0\n"," Downloading tenacity-8.3.0-py3-none-any.whl (25 kB)\n", "Requirement already satisfied: packaging in /home/tudov/.local/lib/python3.10/site-packages (from plotly) (24.0)\n", "Installing collected packages: tenacity, plotly\n",
@@ -223,11 +223,11 @@
"Defaulting to user installation because normal site-packages is not writeable\n", "Collecting ruamel.yaml\n", " Downloading ruamel.yaml-0.18.6-py3-none-any.whl (117 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m117.8/117.8 KB\u001b[0m \u001b[31m773.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m[31m1.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n","\u001b[?25hCollecting ruamel.yaml.clib>=0.2.7\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m117.8/117.8 KB\u001B[0m \u001B[31m773.9 kB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m[31m1.3 MB/s\u001B[0m eta \u001B[36m0:00:01\u001B[0m\n", "\u001B[?25hCollecting ruamel.yaml.clib>=0.2.7\n"," Downloading ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (526 kB)\n", "\u001b[2K \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m526.7/526.7 KB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\n","\u001b[?25hInstalling collected packages: ruamel.yaml.clib, ruamel.yaml\n","\u001B[2K \u001B[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m526.7/526.7 KB\u001B[0m \u001B[31m5.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m[31m6.3 MB/s\u001B[0m eta \u001B[36m0:00:01\u001B[0m\n", "\u001B[?25hInstalling collected packages: ruamel.yaml.clib, ruamel.yaml\n","Successfully installed ruamel.yaml-0.18.6 ruamel.yaml.clib-0.2.8\n", "Note: you may need to restart the kernel to use updated packages.\n" ]
@@ -726,35 +726,13 @@
}, { "cell_type": "code", "execution_count": 4,"id": "cf66bcb81e1b29f", "metadata": { "ExecuteTime": { "end_time": "2024-05-25T09:10:46.746378Z","start_time": "2024-05-25T09:04:33.280298Z""end_time": "2024-05-26T16:53:48.532397Z", "start_time": "2024-05-26T16:50:58.288905Z"} }, "outputs": [{"name": "stdout","output_type": "stream","text": ["WARNING ⚠️ 'source' is missing. Using 'source=/home/tudov/.local/lib/python3.10/site-packages/ultralytics/assets'.\n"]},{"ename": "AttributeError","evalue": "'NoneType' object has no attribute '__array_interface__'","output_type": "error","traceback": ["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)","Cell \u001b[0;32mIn[4], line 48\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(box\u001b[38;5;241m.\u001b[39mcls[\u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 47\u001b[0m \u001b[38;5;66;03m# Object label\u001b[39;00m\n\u001b[0;32m---> 48\u001b[0m img_pil \u001b[38;5;241m=\u001b[39m \u001b[43mImage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfromarray\u001b[49m\u001b[43m(\u001b[49m\u001b[43mimg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 49\u001b[0m draw \u001b[38;5;241m=\u001b[39m ImageDraw\u001b[38;5;241m.\u001b[39mDraw(img_pil)\n\u001b[1;32m 50\u001b[0m draw\u001b[38;5;241m.\u001b[39mtext((x1, y1),\n\u001b[1;32m 51\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mconfidence\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m%] \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mclass_mapping[\u001b[38;5;28mcls\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 52\u001b[0m font\u001b[38;5;241m=\u001b[39mfont,\n\u001b[1;32m 53\u001b[0m fill\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m255\u001b[39m, \u001b[38;5;241m255\u001b[39m, \u001b[38;5;241m255\u001b[39m),\n\u001b[1;32m 54\u001b[0m stroke_width\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m,\n\u001b[1;32m 55\u001b[0m stroke_fill\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m))\n","File \u001b[0;32m~/.local/lib/python3.10/site-packages/PIL/Image.py:3119\u001b[0m, in \u001b[0;36mfromarray\u001b[0;34m(obj, mode)\u001b[0m\n\u001b[1;32m 3072\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mfromarray\u001b[39m(obj, mode\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[1;32m 3073\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 3074\u001b[0m \u001b[38;5;124;03m Creates an image memory from an object exporting the array interface\u001b[39;00m\n\u001b[1;32m 3075\u001b[0m \u001b[38;5;124;03m (using the buffer protocol)::\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3117\u001b[0m \u001b[38;5;124;03m .. versionadded:: 1.1.6\u001b[39;00m\n\u001b[1;32m 3118\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 3119\u001b[0m arr \u001b[38;5;241m=\u001b[39m \u001b[43mobj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__array_interface__\u001b[49m\n\u001b[1;32m 3120\u001b[0m shape \u001b[38;5;241m=\u001b[39m arr[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mshape\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 3121\u001b[0m ndim \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(shape)\n","\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute '__array_interface__'"]}],"source": [ "from ultralytics import YOLO\n", "import os\n",
@@ -821,7 +799,36 @@
"# Stop the webcam\n", "cap.release()\n", "cv.destroyAllWindows()" ]], "outputs": [ { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", "\u001B[0;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", "Cell \u001B[0;32mIn[20], line 28\u001B[0m\n\u001B[1;32m 25\u001B[0m success, img \u001B[38;5;241m=\u001B[39m cap\u001B[38;5;241m.\u001B[39mread()\n\u001B[1;32m 26\u001B[0m results \u001B[38;5;241m=\u001B[39m model(img, stream\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m, verbose\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mFalse\u001B[39;00m)\n\u001B[0;32m---> 28\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m r \u001B[38;5;129;01min\u001B[39;00m results:\n\u001B[1;32m 29\u001B[0m boxes \u001B[38;5;241m=\u001B[39m r\u001B[38;5;241m.\u001B[39mboxes\n\u001B[1;32m 31\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m box \u001B[38;5;129;01min\u001B[39;00m boxes:\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/utils/_contextlib.py:35\u001B[0m, in \u001B[0;36m_wrap_generator.<locals>.generator_context\u001B[0;34m(*args, **kwargs)\u001B[0m\n\u001B[1;32m 32\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 33\u001B[0m \u001B[38;5;66;03m# Issuing `None` to a generator fires it up\u001B[39;00m\n\u001B[1;32m 34\u001B[0m \u001B[38;5;28;01mwith\u001B[39;00m ctx_factory():\n\u001B[0;32m---> 35\u001B[0m response \u001B[38;5;241m=\u001B[39m \u001B[43mgen\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msend\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m)\u001B[49m\n\u001B[1;32m 37\u001B[0m \u001B[38;5;28;01mwhile\u001B[39;00m \u001B[38;5;28;01mTrue\u001B[39;00m:\n\u001B[1;32m 38\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 39\u001B[0m \u001B[38;5;66;03m# Forward the response to our caller and get its next request\u001B[39;00m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/engine/predictor.py:248\u001B[0m, in \u001B[0;36mBasePredictor.stream_inference\u001B[0;34m(self, source, model, *args, **kwargs)\u001B[0m\n\u001B[1;32m 246\u001B[0m \u001B[38;5;66;03m# Inference\u001B[39;00m\n\u001B[1;32m 247\u001B[0m \u001B[38;5;28;01mwith\u001B[39;00m profilers[\u001B[38;5;241m1\u001B[39m]:\n\u001B[0;32m--> 248\u001B[0m preds \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43minference\u001B[49m\u001B[43m(\u001B[49m\u001B[43mim\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 249\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39margs\u001B[38;5;241m.\u001B[39membed:\n\u001B[1;32m 250\u001B[0m \u001B[38;5;28;01myield from\u001B[39;00m [preds] \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(preds, torch\u001B[38;5;241m.\u001B[39mTensor) \u001B[38;5;28;01melse\u001B[39;00m preds \u001B[38;5;66;03m# yield embedding tensors\u001B[39;00m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/engine/predictor.py:142\u001B[0m, in \u001B[0;36mBasePredictor.inference\u001B[0;34m(self, im, *args, **kwargs)\u001B[0m\n\u001B[1;32m 136\u001B[0m \u001B[38;5;250m\u001B[39m\u001B[38;5;124;03m\"\"\"Runs inference on a given image using the specified model and arguments.\"\"\"\u001B[39;00m\n\u001B[1;32m 137\u001B[0m visualize \u001B[38;5;241m=\u001B[39m (\n\u001B[1;32m 138\u001B[0m increment_path(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msave_dir \u001B[38;5;241m/\u001B[39m Path(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mbatch[\u001B[38;5;241m0\u001B[39m][\u001B[38;5;241m0\u001B[39m])\u001B[38;5;241m.\u001B[39mstem, mkdir\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m)\n\u001B[1;32m 139\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39margs\u001B[38;5;241m.\u001B[39mvisualize \u001B[38;5;129;01mand\u001B[39;00m (\u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msource_type\u001B[38;5;241m.\u001B[39mtensor)\n\u001B[1;32m 140\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m \u001B[38;5;28;01mFalse\u001B[39;00m\n\u001B[1;32m 141\u001B[0m )\n\u001B[0;32m--> 142\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mmodel\u001B[49m\u001B[43m(\u001B[49m\u001B[43mim\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43maugment\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43margs\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43maugment\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mvisualize\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mvisualize\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43membed\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43margs\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43membed\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1532\u001B[0m, in \u001B[0;36mModule._wrapped_call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1530\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_compiled_call_impl(\u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs) \u001B[38;5;66;03m# type: ignore[misc]\u001B[39;00m\n\u001B[1;32m 1531\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m-> 1532\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_call_impl\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1541\u001B[0m, in \u001B[0;36mModule._call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1536\u001B[0m \u001B[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001B[39;00m\n\u001B[1;32m 1537\u001B[0m \u001B[38;5;66;03m# this function, and just call forward.\u001B[39;00m\n\u001B[1;32m 1538\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m (\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_pre_hooks\n\u001B[1;32m 1539\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_backward_hooks\n\u001B[1;32m 1540\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_forward_pre_hooks):\n\u001B[0;32m-> 1541\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mforward_call\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 1543\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 1544\u001B[0m result \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/nn/autobackend.py:453\u001B[0m, in \u001B[0;36mAutoBackend.forward\u001B[0;34m(self, im, augment, visualize, embed)\u001B[0m\n\u001B[1;32m 451\u001B[0m \u001B[38;5;66;03m# PyTorch\u001B[39;00m\n\u001B[1;32m 452\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mpt \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mnn_module:\n\u001B[0;32m--> 453\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mmodel\u001B[49m\u001B[43m(\u001B[49m\u001B[43mim\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43maugment\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43maugment\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mvisualize\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mvisualize\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43membed\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43membed\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 455\u001B[0m \u001B[38;5;66;03m# TorchScript\u001B[39;00m\n\u001B[1;32m 456\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mjit:\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1532\u001B[0m, in \u001B[0;36mModule._wrapped_call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1530\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_compiled_call_impl(\u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs) \u001B[38;5;66;03m# type: ignore[misc]\u001B[39;00m\n\u001B[1;32m 1531\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m-> 1532\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_call_impl\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1541\u001B[0m, in \u001B[0;36mModule._call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1536\u001B[0m \u001B[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001B[39;00m\n\u001B[1;32m 1537\u001B[0m \u001B[38;5;66;03m# this function, and just call forward.\u001B[39;00m\n\u001B[1;32m 1538\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m (\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_pre_hooks\n\u001B[1;32m 1539\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_backward_hooks\n\u001B[1;32m 1540\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_forward_pre_hooks):\n\u001B[0;32m-> 1541\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mforward_call\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 1543\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 1544\u001B[0m result \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/nn/tasks.py:89\u001B[0m, in \u001B[0;36mBaseModel.forward\u001B[0;34m(self, x, *args, **kwargs)\u001B[0m\n\u001B[1;32m 87\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mdict\u001B[39m): \u001B[38;5;66;03m# for cases of training and validating while training.\u001B[39;00m\n\u001B[1;32m 88\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mloss(x, \u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs)\n\u001B[0;32m---> 89\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mpredict\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/nn/tasks.py:107\u001B[0m, in \u001B[0;36mBaseModel.predict\u001B[0;34m(self, x, profile, visualize, augment, embed)\u001B[0m\n\u001B[1;32m 105\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m augment:\n\u001B[1;32m 106\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_predict_augment(x)\n\u001B[0;32m--> 107\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_predict_once\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mprofile\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mvisualize\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43membed\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/nn/tasks.py:128\u001B[0m, in \u001B[0;36mBaseModel._predict_once\u001B[0;34m(self, x, profile, visualize, embed)\u001B[0m\n\u001B[1;32m 126\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m profile:\n\u001B[1;32m 127\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_profile_one_layer(m, x, dt)\n\u001B[0;32m--> 128\u001B[0m x \u001B[38;5;241m=\u001B[39m \u001B[43mm\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m)\u001B[49m \u001B[38;5;66;03m# run\u001B[39;00m\n\u001B[1;32m 129\u001B[0m y\u001B[38;5;241m.\u001B[39mappend(x \u001B[38;5;28;01mif\u001B[39;00m m\u001B[38;5;241m.\u001B[39mi \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msave \u001B[38;5;28;01melse\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m) \u001B[38;5;66;03m# save output\u001B[39;00m\n\u001B[1;32m 130\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m visualize:\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1532\u001B[0m, in \u001B[0;36mModule._wrapped_call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1530\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_compiled_call_impl(\u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs) \u001B[38;5;66;03m# type: ignore[misc]\u001B[39;00m\n\u001B[1;32m 1531\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m-> 1532\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_call_impl\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1541\u001B[0m, in \u001B[0;36mModule._call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1536\u001B[0m \u001B[38;5;66;03m# If we don't have any hooks, we want to skip the rest of the logic in\u001B[39;00m\n\u001B[1;32m 1537\u001B[0m \u001B[38;5;66;03m# this function, and just call forward.\u001B[39;00m\n\u001B[1;32m 1538\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m (\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_forward_pre_hooks\n\u001B[1;32m 1539\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_backward_pre_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_backward_hooks\n\u001B[1;32m 1540\u001B[0m \u001B[38;5;129;01mor\u001B[39;00m _global_forward_hooks \u001B[38;5;129;01mor\u001B[39;00m _global_forward_pre_hooks):\n\u001B[0;32m-> 1541\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mforward_call\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 1543\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 1544\u001B[0m result \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/ultralytics/nn/modules/head.py:47\u001B[0m, in \u001B[0;36mDetect.forward\u001B[0;34m(self, x)\u001B[0m\n\u001B[1;32m 45\u001B[0m \u001B[38;5;250m\u001B[39m\u001B[38;5;124;03m\"\"\"Concatenates and returns predicted bounding boxes and class probabilities.\"\"\"\u001B[39;00m\n\u001B[1;32m 46\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m i \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mrange\u001B[39m(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mnl):\n\u001B[0;32m---> 47\u001B[0m x[i] \u001B[38;5;241m=\u001B[39m torch\u001B[38;5;241m.\u001B[39mcat((\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcv2\u001B[49m\u001B[43m[\u001B[49m\u001B[43mi\u001B[49m\u001B[43m]\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m[\u001B[49m\u001B[43mi\u001B[49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m, \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcv3[i](x[i])), \u001B[38;5;241m1\u001B[39m)\n\u001B[1;32m 48\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mtraining: \u001B[38;5;66;03m# Training path\u001B[39;00m\n\u001B[1;32m 49\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m x\n", "File \u001B[0;32m~/miniconda3/envs/tf/lib/python3.10/site-packages/torch/nn/modules/module.py:1528\u001B[0m, in \u001B[0;36mModule._wrapped_call_impl\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m 1525\u001B[0m tracing_state\u001B[38;5;241m.\u001B[39mpop_scope()\n\u001B[1;32m 1526\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m result\n\u001B[0;32m-> 1528\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21m_wrapped_call_impl\u001B[39m(\u001B[38;5;28mself\u001B[39m, \u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs):\n\u001B[1;32m 1529\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_compiled_call_impl \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m 1530\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_compiled_call_impl(\u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs) \u001B[38;5;66;03m# type: ignore[misc]\u001B[39;00m\n", "\u001B[0;31mKeyboardInterrupt\u001B[0m: " ] } ], "execution_count": 20}, { "cell_type": "markdown",
@@ -833,36 +840,18 @@
}, { "cell_type": "code", "execution_count": 3,"id": "5c3a7e358cf3efb5", "metadata": {},"outputs": [{"name": "stdout","output_type": "stream","text": ["\n","0: 640x640 1 Plastic, 71.6ms\n","Speed: 5.6ms preprocess, 71.6ms inference, 0.8ms postprocess per image at shape (1, 3, 640, 640)\n"]},{"ename": "NameError","evalue": "name 'class_mapping' is not defined","output_type": "error","traceback": ["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)","Cell \u001b[0;32mIn[3], line 52\u001b[0m\n\u001b[1;32m 48\u001b[0m img_pil \u001b[38;5;241m=\u001b[39m Image\u001b[38;5;241m.\u001b[39mfromarray(img)\n\u001b[1;32m 49\u001b[0m draw \u001b[38;5;241m=\u001b[39m ImageDraw\u001b[38;5;241m.\u001b[39mDraw(img_pil)\n\u001b[1;32m 51\u001b[0m draw\u001b[38;5;241m.\u001b[39mtext((x1, y1),\n\u001b[0;32m---> 52\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m[\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mconfidence\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m%] \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[43mclass_mapping\u001b[49m[\u001b[38;5;28mcls\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 53\u001b[0m font\u001b[38;5;241m=\u001b[39mfont,\n\u001b[1;32m 54\u001b[0m fill\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m255\u001b[39m, \u001b[38;5;241m255\u001b[39m, \u001b[38;5;241m255\u001b[39m),\n\u001b[1;32m 55\u001b[0m stroke_width\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m,\n\u001b[1;32m 56\u001b[0m stroke_fill\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m))\n\u001b[1;32m 57\u001b[0m img \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray(img_pil)\n\u001b[1;32m 59\u001b[0m cv\u001b[38;5;241m.\u001b[39mimwrite(os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mjoin(output_dir, os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mbasename(image_path\u001b[38;5;241m.\u001b[39mpath)), img)\n","\u001b[0;31mNameError\u001b[0m: name 'class_mapping' is not defined"]"metadata": { "ExecuteTime": { "end_time": "2024-05-26T15:28:54.658369Z", "start_time": "2024-05-26T15:28:49.740170Z"} ],},"source": [ "from ultralytics import YOLO\n", "import os\n", "\n", "model = YOLO(\"runs/detect/train23/weights/last.pt\")\n","model = YOLO(\"runs/detect/train26/weights/last.pt\")\n","\n", "import cv2 as cv\n", "import numpy as np\n",
@@ -875,7 +864,7 @@
"import numpy as np\n", "import math\n", "\n", "font = ImageFont.truetype(\"/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf\", 20)\n","font = ImageFont.truetype(\"~/.local/share/fonts/Roboto-Regular.ttf\", 40)\n","\n", "image_dir = \"./test_data/\"\n", "output_dir = \"./output/\"\n",
@@ -921,7 +910,120 @@
" #cv.imshow(\"Photo\", img)\n", " #cv.waitKey(27) # escape\n", " #cv.destroyAllWindows()" ]], "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "0: 640x640 1 Glass, 21.5ms\n", "Speed: 1.8ms preprocess, 21.5ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 40.2ms\n", "Speed: 1.2ms preprocess, 40.2ms inference, 0.5ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 27.3ms\n", "Speed: 2.9ms preprocess, 27.3ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Paper, 65.2ms\n", "Speed: 3.7ms preprocess, 65.2ms inference, 0.7ms postprocess per image at shape (1, 3, 640, 640)\n", "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/vlad/.local/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning:\n", "\n", "Mean of empty slice.\n", "\n", "/home/vlad/.local/lib/python3.10/site-packages/numpy/core/_methods.py:190: RuntimeWarning:\n", "\n", "invalid value encountered in double_scalars\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "0: 640x640 (no detections), 37.9ms\n", "Speed: 4.0ms preprocess, 37.9ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 31.0ms\n", "Speed: 12.4ms preprocess, 31.0ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 21.6ms\n", "Speed: 1.7ms preprocess, 21.6ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 480x640 1 Plastic, 22.5ms\n", "Speed: 1.2ms preprocess, 22.5ms inference, 0.4ms postprocess per image at shape (1, 3, 480, 640)\n", "\n", "0: 640x640 4 Plastics, 21.2ms\n", "Speed: 1.7ms preprocess, 21.2ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 3 Metals, 23.6ms\n", "Speed: 1.8ms preprocess, 23.6ms inference, 0.7ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 21.8ms\n", "Speed: 1.4ms preprocess, 21.8ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 1 Glass, 22.5ms\n", "Speed: 2.1ms preprocess, 22.5ms inference, 0.5ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Glass, 24.5ms\n", "Speed: 1.7ms preprocess, 24.5ms inference, 0.5ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 20.8ms\n", "Speed: 1.2ms preprocess, 20.8ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Paper, 20.3ms\n", "Speed: 1.7ms preprocess, 20.3ms inference, 0.5ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Glass, 20.2ms\n", "Speed: 1.8ms preprocess, 20.2ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 2 Metals, 19.5ms\n", "Speed: 1.3ms preprocess, 19.5ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Paper, 21.3ms\n", "Speed: 1.7ms preprocess, 21.3ms inference, 0.5ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 19.5ms\n", "Speed: 1.4ms preprocess, 19.5ms inference, 0.2ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 30.9ms\n", "Speed: 2.9ms preprocess, 30.9ms inference, 0.7ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 3 Papers, 89.0ms\n", "Speed: 61.3ms preprocess, 89.0ms inference, 0.8ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 26.7ms\n", "Speed: 1.5ms preprocess, 26.7ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Glass, 27.0ms\n", "Speed: 1.7ms preprocess, 27.0ms inference, 0.7ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 28.0ms\n", "Speed: 1.7ms preprocess, 28.0ms inference, 0.8ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 18.8ms\n", "Speed: 1.3ms preprocess, 18.8ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 19.1ms\n", "Speed: 1.3ms preprocess, 19.1ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 (no detections), 20.3ms\n", "Speed: 1.5ms preprocess, 20.3ms inference, 0.3ms postprocess per image at shape (1, 3, 640, 640)\n", "\n", "0: 640x640 1 Plastic, 20.5ms\n", "Speed: 1.9ms preprocess, 20.5ms inference, 0.4ms postprocess per image at shape (1, 3, 640, 640)\n" ] } ], "execution_count": 19}, { "cell_type": "code",