Last active
September 23, 2023 18:45
-
-
Save daniel-falk/edf67c94ebeccdcd2cbfeb2c3afab1c7 to your computer and use it in GitHub Desktop.
Untitled8.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"provenance": [], | |
"authorship_tag": "ABX9TyPpfmDZPYCjdO+NJcy8jUMh", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/daniel-falk/edf67c94ebeccdcd2cbfeb2c3afab1c7/untitled8.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "IAW3IT1GV5lx", | |
"outputId": "8e712fbe-f01e-44e1-d564-0be780a09074" | |
}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Collecting deeplake[enterprise]==3.7.0\n", | |
" Downloading deeplake-3.7.0.tar.gz (554 kB)\n", | |
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/554.4 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m81.9/554.4 kB\u001b[0m \u001b[31m2.6 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m \u001b[32m553.0/554.4 kB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m554.4/554.4 kB\u001b[0m \u001b[31m6.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", | |
" Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", | |
" Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", | |
"Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deeplake[enterprise]==3.7.0) (1.23.5)\n", | |
"Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from deeplake[enterprise]==3.7.0) (9.4.0)\n", | |
"Collecting boto3 (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading boto3-1.28.53-py3-none-any.whl (135 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m13.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from deeplake[enterprise]==3.7.0) (8.1.7)\n", | |
"Collecting pathos (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading pathos-0.3.1-py3-none-any.whl (82 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.1/82.1 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting humbug>=0.3.1 (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading humbug-0.3.2-py3-none-any.whl (15 kB)\n", | |
"Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deeplake[enterprise]==3.7.0) (4.66.1)\n", | |
"Collecting numcodecs (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading numcodecs-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.7/6.7 MB\u001b[0m \u001b[31m77.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: pyjwt in /usr/lib/python3/dist-packages (from deeplake[enterprise]==3.7.0) (2.3.0)\n", | |
"Collecting aioboto3>=10.4.0 (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading aioboto3-11.3.0-py3-none-any.whl (32 kB)\n", | |
"Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.10/dist-packages (from deeplake[enterprise]==3.7.0) (1.5.7)\n", | |
"Collecting libdeeplake==0.0.78 (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading libdeeplake-0.0.78-cp310-cp310-manylinux2010_x86_64.whl (12.0 MB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.0/12.0 MB\u001b[0m \u001b[31m77.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting dill (from libdeeplake==0.0.78->deeplake[enterprise]==3.7.0)\n", | |
" Downloading dill-0.3.7-py3-none-any.whl (115 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m12.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting aiobotocore[boto3]==2.6.0 (from aioboto3>=10.4.0->deeplake[enterprise]==3.7.0)\n", | |
" Downloading aiobotocore-2.6.0-py3-none-any.whl (73 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m73.4/73.4 kB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting botocore<1.31.18,>=1.31.17 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0)\n", | |
" Downloading botocore-1.31.17-py3-none-any.whl (11.1 MB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.1/11.1 MB\u001b[0m \u001b[31m62.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: aiohttp<4.0.0,>=3.7.4.post0 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (3.8.5)\n", | |
"Requirement already satisfied: wrapt<2.0.0,>=1.10.10 in /usr/local/lib/python3.10/dist-packages (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (1.15.0)\n", | |
"Collecting aioitertools<1.0.0,>=0.5.1 (from aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0)\n", | |
" Downloading aioitertools-0.11.0-py3-none-any.whl (23 kB)\n", | |
"Collecting boto3 (from deeplake[enterprise]==3.7.0)\n", | |
" Downloading boto3-1.28.17-py3-none-any.whl (135 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.8/135.8 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting jmespath<2.0.0,>=0.7.1 (from boto3->deeplake[enterprise]==3.7.0)\n", | |
" Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)\n", | |
"Collecting s3transfer<0.7.0,>=0.6.0 (from boto3->deeplake[enterprise]==3.7.0)\n", | |
" Downloading s3transfer-0.6.2-py3-none-any.whl (79 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m79.8/79.8 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from humbug>=0.3.1->deeplake[enterprise]==3.7.0) (2.31.0)\n", | |
"Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from numcodecs->deeplake[enterprise]==3.7.0) (0.4)\n", | |
"Collecting ppft>=1.7.6.7 (from pathos->deeplake[enterprise]==3.7.0)\n", | |
" Downloading ppft-1.7.6.7-py3-none-any.whl (56 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.8/56.8 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hCollecting pox>=0.3.3 (from pathos->deeplake[enterprise]==3.7.0)\n", | |
" Downloading pox-0.3.3-py3-none-any.whl (29 kB)\n", | |
"Collecting multiprocess>=0.70.15 (from pathos->deeplake[enterprise]==3.7.0)\n", | |
" Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m13.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.10/dist-packages (from botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (2.8.2)\n", | |
"Collecting urllib3<1.27,>=1.25.4 (from botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0)\n", | |
" Downloading urllib3-1.26.16-py2.py3-none-any.whl (143 kB)\n", | |
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.1/143.1 kB\u001b[0m \u001b[31m13.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", | |
"\u001b[?25hRequirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->humbug>=0.3.1->deeplake[enterprise]==3.7.0) (3.2.0)\n", | |
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->humbug>=0.3.1->deeplake[enterprise]==3.7.0) (3.4)\n", | |
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->humbug>=0.3.1->deeplake[enterprise]==3.7.0) (2023.7.22)\n", | |
"Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (23.1.0)\n", | |
"Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (6.0.4)\n", | |
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (4.0.3)\n", | |
"Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (1.9.2)\n", | |
"Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (1.4.0)\n", | |
"Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.7.4.post0->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (1.3.1)\n", | |
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.31.18,>=1.31.17->aiobotocore[boto3]==2.6.0->aioboto3>=10.4.0->deeplake[enterprise]==3.7.0) (1.16.0)\n", | |
"Building wheels for collected packages: deeplake\n", | |
" Building wheel for deeplake (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", | |
" Created wheel for deeplake: filename=deeplake-3.7.0-py3-none-any.whl size=668715 sha256=5953cff0ee1c302383c6a15621df2f0f79b7e71e2d3ecd3a93faf080e3600563\n", | |
" Stored in directory: /root/.cache/pip/wheels/ed/22/e7/6bc495c1d61555636ce18d689077030ee1222573bb4412e67f\n", | |
"Successfully built deeplake\n", | |
"Installing collected packages: urllib3, ppft, pox, numcodecs, jmespath, dill, aioitertools, multiprocess, libdeeplake, botocore, s3transfer, pathos, humbug, aiobotocore, boto3, aioboto3, deeplake\n", | |
" Attempting uninstall: urllib3\n", | |
" Found existing installation: urllib3 2.0.4\n", | |
" Uninstalling urllib3-2.0.4:\n", | |
" Successfully uninstalled urllib3-2.0.4\n", | |
"Successfully installed aioboto3-11.3.0 aiobotocore-2.6.0 aioitertools-0.11.0 boto3-1.28.17 botocore-1.31.17 deeplake-3.7.0 dill-0.3.7 humbug-0.3.2 jmespath-1.0.1 libdeeplake-0.0.78 multiprocess-0.70.15 numcodecs-0.11.0 pathos-0.3.1 pox-0.3.3 ppft-1.7.6.7 s3transfer-0.6.2 urllib3-1.26.16\n" | |
] | |
} | |
], | |
"source": [ | |
"!pip install deeplake[enterprise]==3.7.0" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import sys\n", | |
"\n", | |
"sys.version" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/", | |
"height": 35 | |
}, | |
"id": "YvWWUNVJWhng", | |
"outputId": "98f93bef-c1c4-4e6e-b246-3a9e5a436994" | |
}, | |
"execution_count": 2, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": [ | |
"'3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]'" | |
], | |
"application/vnd.google.colaboratory.intrinsic+json": { | |
"type": "string" | |
} | |
}, | |
"metadata": {}, | |
"execution_count": 2 | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import deeplake\n", | |
"\n", | |
"train_ds = deeplake.load('hub://activeloop/coco-train')\n", | |
"\n", | |
"# This hangs forever...\n", | |
"train_people_cars = train_ds.query(\"select * where contains(categories, 'car')\")" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "ZoCAXdRjV9GG", | |
"outputId": "d7937db9-d8cf-4e63-fc63-2a049c49f4ef" | |
}, | |
"execution_count": null, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stderr", | |
"text": [ | |
"|" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Opening dataset in read-only mode as you don't have write permissions.\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stderr", | |
"text": [ | |
"\\" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"This dataset can be visualized in Jupyter Notebook by ds.visualize() or at https://app.activeloop.ai/activeloop/coco-train\n", | |
"\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stderr", | |
"text": [ | |
"-" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"hub://activeloop/coco-train loaded successfully.\n", | |
"\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stderr", | |
"text": [] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"len(train_people_cars)" | |
], | |
"metadata": { | |
"id": "ygX97zLmWUQC" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [], | |
"metadata": { | |
"id": "dEnpRNa7aLNQ" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment