From 4ba0177b9eb7ce6182602e3102e258a436465797 Mon Sep 17 00:00:00 2001 From: Gregory Lee Date: Wed, 13 Dec 2023 12:26:29 -0800 Subject: [PATCH] remove redundant notebook (#668) closes #656 We are retaining `notebooks/Using_Cache.ipynb` which covers use of the image cache. This top-level notebook is not needed. Authors: - Gregory Lee (https://github.com/grlee77) Approvers: - https://github.com/jakirkham - Gigon Bae (https://github.com/gigony) URL: https://github.com/rapidsai/cucim/pull/668 --- Cache Example.ipynb | 531 -------------------------------------------- 1 file changed, 531 deletions(-) delete mode 100644 Cache Example.ipynb diff --git a/Cache Example.ipynb b/Cache Example.ipynb deleted file mode 100644 index ae686fabd..000000000 --- a/Cache Example.ipynb +++ /dev/null @@ -1,531 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "69aeee77", - "metadata": {}, - "outputs": [], - "source": [ - "from cucim import CuImage\n", - "from cucim.clara.cache import calc_preferred_cache_memory\n", - "\n", - "img = CuImage(\"notebooks/input/image.tif\")\n", - "memory_capacity = calc_preferred_cache_memory(img, (256, 256))\n", - "CuImage.cache(\"per_process\", memory_capacity=memory_capacity, record_stat=True)\n", - "#CuImage.cache(\"per_process\", memory_capacity=2048, record_stat=True)\n", - "\n", - "region = img.read_region((0,0), (100,100))\n", - "\n", - "cache = CuImage.cache()" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "f2121d1b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'type': 'per_process',\n", - " 'memory_capacity': 2048,\n", - " 'capacity': 5461,\n", - " 'mutex_pool_capacity': 11117,\n", - " 'list_padding': 10000,\n", - " 'extra_shared_memory_size': 100,\n", - " 'record_stat': True}" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cache.config" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "fbea8f0a", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "cache hit: 0, chche miss: 1\n" - ] - } - ], - "source": [ - "print(f\"cache hit: {cache.hit_count}, chche miss: {cache.miss_count}\")" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "0f60842a", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "cache hit: 1, chche miss: 1\n", - "items in cache: 1/5461, memory usage in cache: 196608/2147483648\n" - ] - } - ], - "source": [ - "region = img.read_region((0,0), (100,100))\n", - "\n", - "print(f\"cache hit: {cache.hit_count}, chche miss: {cache.miss_count}\")\n", - "print(f\"items in cache: {cache.size}/{cache.capacity}, memory usage in cache: {cache.memory_size}/{cache.memory_capacity}\")" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "5453dbcc", - "metadata": {}, - "outputs": [], - "source": [ - "from cucim import CuImage\n", - "img = CuImage(\"notebooks/input/image.tif\")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "059d8ba3", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['__bool__',\n", - " '__class__',\n", - " '__delattr__',\n", - " '__dict__',\n", - " '__dir__',\n", - " '__doc__',\n", - " '__eq__',\n", - " '__format__',\n", - " '__ge__',\n", - " '__getattribute__',\n", - " '__gt__',\n", - " '__hash__',\n", - " '__init__',\n", - " '__init_subclass__',\n", - " '__le__',\n", - " '__lt__',\n", - " '__module__',\n", - " '__ne__',\n", - " '__new__',\n", - " '__reduce__',\n", - " '__reduce_ex__',\n", - " '__repr__',\n", - " '__setattr__',\n", - " '__sizeof__',\n", - " '__str__',\n", - " '__subclasshook__',\n", - " '_set_array_interface',\n", - " 'associated_image',\n", - " 'associated_images',\n", - " 'cache',\n", - " 'channel_names',\n", - " 'coord_sys',\n", - " 'device',\n", - " 'dims',\n", - " 'direction',\n", - " 'dtype',\n", - " 'is_loaded',\n", - " 'metadata',\n", - " 'ndim',\n", - " 'origin',\n", - " 'path',\n", - " 'raw_metadata',\n", - " 'read_region',\n", - " 'resolutions',\n", - " 'save',\n", - " 'shape',\n", - " 'size',\n", - " 'spacing',\n", - " 'spacing_units']" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dir(img._C)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "895db3d2", - "metadata": {}, - "outputs": [], - "source": [ - "from cucim import CuImage\n", - "\n", - "img = CuImage(\"notebooks/input/image.tif\")" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "1800de44", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "430 ns ± 4.64 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)\n" - ] - } - ], - "source": [ - "%%timeit\n", - "\n", - "img.is_loaded" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "3a85c7ff", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "177 ns ± 1.51 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)\n" - ] - } - ], - "source": [ - "%%timeit\n", - "img._C.is_loaded" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "a3872e46", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Processing ./dist/cucim-0.19.1.dev2-py3-none-manylinux2014_x86_64.whl\n", - "Collecting numpy\n", - " Using cached numpy-1.20.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB)\n", - "Collecting click\n", - " Using cached click-8.0.1-py3-none-any.whl (97 kB)\n", - "Installing collected packages: numpy, click, cucim\n", - " Attempting uninstall: numpy\n", - " Found existing installation: numpy 1.20.3\n", - " Uninstalling numpy-1.20.3:\n", - " Successfully uninstalled numpy-1.20.3\n", - " Attempting uninstall: click\n", - " Found existing installation: click 8.0.1\n", - " Uninstalling click-8.0.1:\n", - " Successfully uninstalled click-8.0.1\n", - " Attempting uninstall: cucim\n", - " Found existing installation: cucim 0.19.1.dev2\n", - " Uninstalling cucim-0.19.1.dev2:\n", - " Successfully uninstalled cucim-0.19.1.dev2\n", - "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", - "rasterio 1.2.3 requires click<8,>=4.0, but you have click 8.0.1 which is incompatible.\n", - "cligj 0.7.1 requires click<8,>=4.0, but you have click 8.0.1 which is incompatible.\u001b[0m\n", - "Successfully installed click-8.0.1 cucim-0.19.1.dev2 numpy-1.20.3\n", - "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.\n", - "You should consider upgrading via the '/home/gbae/.virtualenvs/cucim/bin/python -m pip install --upgrade pip' command.\u001b[0m\n" - ] - }, - { - "data": { - "text/plain": [ - "['__bool__',\n", - " '__class__',\n", - " '__delattr__',\n", - " '__dict__',\n", - " '__dir__',\n", - " '__doc__',\n", - " '__eq__',\n", - " '__format__',\n", - " '__ge__',\n", - " '__getattribute__',\n", - " '__gt__',\n", - " '__hash__',\n", - " '__init__',\n", - " '__init_subclass__',\n", - " '__le__',\n", - " '__lt__',\n", - " '__module__',\n", - " '__ne__',\n", - " '__new__',\n", - " '__reduce__',\n", - " '__reduce_ex__',\n", - " '__repr__',\n", - " '__setattr__',\n", - " '__sizeof__',\n", - " '__str__',\n", - " '__subclasshook__',\n", - " '_set_array_interface',\n", - " 'associated_image',\n", - " 'associated_images',\n", - " 'cache',\n", - " 'channel_names',\n", - " 'coord_sys',\n", - " 'device',\n", - " 'dims',\n", - " 'direction',\n", - " 'dtype',\n", - " 'is_loaded',\n", - " 'metadata',\n", - " 'ndim',\n", - " 'origin',\n", - " 'path',\n", - " 'raw_metadata',\n", - " 'read_region',\n", - " 'resolutions',\n", - " 'save',\n", - " 'shape',\n", - " 'size',\n", - " 'spacing',\n", - " 'spacing_units']" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "!pip install --force-reinstall dist/*.whl\n", - "\n", - "dir(img)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "5ec0b0d6", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "161 ns ± 0.967 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)\n" - ] - } - ], - "source": [ - "%%timeit\n", - "\n", - "img.is_loaded" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "fcc68767", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Help on method read_region in module cucim.clara._cucim:\n", - "\n", - "read_region(...) method of cucim.clara.CuImage instance\n", - " read_region(self: cucim.clara._cucim.CuImage, location: List[int] = [], size: List[int] = [], level: int = 0, device: cucim.clara._cucim.io.Device = cpu, buf: object = None, shm_name: str = '', **kwargs) -> object\n", - " \n", - " Returns a subresolution image.\n", - " \n", - " - `location` and `size`'s dimension order is reverse of image's dimension order.\n", - " - Need to specify (X,Y) and (Width, Height) instead of (Y,X) and (Height, Width).\n", - " - If location is not specified, location would be (0, 0) if Z=0. Otherwise, location would be (0, 0, 0)\n", - " - Like OpenSlide, location is level-0 based coordinates (using the level-0 reference frame)\n", - " - If `size` is not specified, size would be (width, height) of the image at the specified `level`.\n", - " - `` Additional parameters (S,T,C,Z) are similar to\n", - " \n", - " - We may not want to support indices/ranges for (S,T,C,Z) for the first release.\n", - " - Default value for level, S, T, Z are zero.\n", - " - Default value for C is -1 (whole channels)\n", - " - `` `device` could be one of the following strings or Device object: e.g., `'cpu'`, `'cuda'`, `'cuda:0'` (use index 0), `cucim.clara.io.Device(cucim.clara.io.CUDA,0)`.\n", - " - `` If `buf` is specified (buf's type can be either numpy object that implements `__array_interface__`, or cupy-compatible object that implements `__cuda_array_interface__`), the read image would be saved into buf object without creating CPU/GPU memory.\n", - " - `` If `shm_name` is specified, shared memory would be created and data would be read in the shared memory.\n", - "\n" - ] - } - ], - "source": [ - "help(img.read_region)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "3397aa75", - "metadata": {}, - "outputs": [], - "source": [ - "from cucim import CuImage\n", - "img = CuImage(\"notebooks/input/image.tif\")\n", - "region = img.read_region((1000,1000), (100, 100))" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "e9595d38", - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAXz0lEQVR4nM1d7ZIcqXI9J6mekXav/P4v6bC9kne1M10c/0hIkqKqpyXda5tQTFRTFCRJfpMg/se3fwcAgKT/9YdDkWT9gSR10sbMJAEwMNeYWa3VzPZ93/cde5W0Q9u2+Vsf0R+q6KPE3wxDG50EUJHfWjz5W2k/fJi7qgl8UiQLxrj5bZ+oAGzrnNeyAg3hgFNJtdYE64Bv33dJ9/sdgJkZTUarNeORpPdAGyB5ZUaB17TKk/Ua0E4t1wbkTBb1tGUqBLQdQDlFUKOp6vUDHbl99GBmAPb7Xms1qJRSa6Xw/v5O8vX1tYJG2zb78/tft9utQoQBBCiI89Ak1WgNZANkgC+dkTgA7KIjrcHGNilJIAj6v1YJ1TN+AkABqCKkM8p6jOMrhEZ945Fa7/e7I67Wiqpaq6TPnz+/vd0lifWvv/7yT7bCtXN06ggaiZUIJl1BjZraGdaLk230cxhO1SSA9UIEUQKozReL/uXVMq2cCEPDeisVFQBhLs6qWHeoygly3ytg9/0u2H3fTdr3/e/v71t52baNpLOwmUkMBptIA0Za/9neZz5F+qYzmvWVE0Cfc60y8+laF7+COd4N9US8wKck24Dg3wblR9z7QQmR4SXkkZf7/R7Sbds2R1B8KGkVRZ3BrdaaxeJjAA50R7KUEuQZusi5sq9QvejRwApgIwWIbFhzIpUUXzaUn4nTmRAbg9TaidkooELFzLZyv99Ztu9v76TRjKiff/+NJItVUDRzsdXYxFLPXf3Ver/fgxnbi64QOmrkQk2qQaROB5L2vTreQAMaYwIxOXOYW+fyPgXAZAA2oNEqnbO6mKj1UhwARwnlM8kKKEhp3/dt21zMm9n9fv/06RMAoLy+bvsuCYHfgeg+YpY76AqklOJvzWw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6eaIeP2lMFSGjRLfsscRxxqJKeFebQgB/MHhD9TDiNexgYZGjIo2jCCf7PF8RMAnYo2hHrmqO9L2iB2dkup54syuRhOH7U5lJj8KSl9+K2k6Trj/HB2+11yGFnh0upIX/7YJAuAu9x/YiVy5oZf3urqJVsnVzJ4Ws6UF6gU/Dt8ga6jXbaO3aCI9CZkhDd+OrqXbaWjf4pQiG6lkd8S9nSTx/ve/2uYjZFUkXe7NHU16p8Ipx05bqnEYLFLNK0ya4iixykGXbtkKvP4wZKB5+e1spSprBLYUhHdqbrfd98BMatxldNmN8w0jklQ9PhSxJs+sGLSvhSh8BbTVTgdZQyh3jDCejBmTrThMzz8TMmdtBseS/Oo7vf7169fAdxut9fXV/+PU3CxvA8sqewe/ASE83DHSMMKTCArR3kudskzfFMQYzkT4eZ4zl6VrMeCAJRSvvz+D/8vZgrtVtzJuJy5wmfrgsdtNw2GHLuHWYE4EtazjTZMgBgjob7Zj0cwtnVL7lqfHjF9Ko/DVlrtPY48xIk0Opc9G9VY1z9/FGP9aHls4qNTlkU8CABQumioM/J9GyXFqmRYB+hwxw0QTWs2nceqaoDxvpVCsph5fARk7mq2Z9DzmpP2dRL3lxw/TtBtnsDPWKpOX0P++n4lBl+3bjMGH1nwByoL+/sgU69oIUayHtcYrzSc0BR6PTGps9dyOsR15dRJVnxreVwfb/8H9xU9HOYLhZsAAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from PIL import Image\n", - "import numpy as np\n", - "Image.fromarray(np.asarray(region))" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "de9a4771", - "metadata": {}, - "outputs": [], - "source": [ - "import cupy as cp\n", - "\n", - "region_cupy = img.read_region((1000,1000), (100, 100), device='cuda')\n", - "vis = cp.asarray(region_cupy)" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "5a932ac8", - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "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9x/YiVy5oZf3urqJVsnVzJ4Ws6UF6gU/Dt8ga6jXbaO3aCI9CZkhDd+OrqXbaWjf4pQiG6lkd8S9nSTx/ve/2uYjZFUkXe7NHU16p8Ipx05bqnEYLFLNK0ya4iixykGXbtkKvP4wZKB5+e1spSprBLYUhHdqbrfd98BMatxldNmN8w0jklQ9PhSxJs+sGLSvhSh8BbTVTgdZQyh3jDCejBmTrThMzz8TMmdtBseS/Oo7vf7169fAdxut9fXV/+PU3CxvA8sqewe/ASE83DHSMMKTCArR3kudskzfFMQYzkT4eZ4zl6VrMeCAJRSvvz+D/8vZgrtVtzJuJy5wmfrgsdtNw2GHLuHWYE4EtazjTZMgBgjob7Zj0cwtnVL7lqfHjF9Ko/DVlrtPY48xIk0Opc9G9VY1z9/FGP9aHls4qNTlkU8CABQumioM/J9GyXFqmRYB+hwxw0QTWs2nceqaoDxvpVCsph5fARk7mq2Z9DzmpP2dRL3lxw/TtBtnsDPWKpOX0P++n4lBl+3bjMGH1nwByoL+/sgU69oIUayHtcYrzSc0BR6PTGps9dyOsR15dRJVnxreVwfb/8H9xU9HOYLhZsAAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "Image.fromarray(vis.get())" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "4098b771", - "metadata": {}, - "outputs": [], - "source": [ - "del vis" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "aac6a6fe", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'data': (46733280, False),\n", - " 'strides': None,\n", - " 'descr': [('', '|u1')],\n", - " 'typestr': '|u1',\n", - " 'shape': (10, 10, 3),\n", - " 'version': 3}" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "b.__array_interface__" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "a836258a", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: cupy-cuda112 in /home/gbae/.virtualenvs/cucim/lib/python3.8/site-packages (9.0.0)\n", - "Requirement already satisfied: numpy>=1.17 in /home/gbae/.virtualenvs/cucim/lib/python3.8/site-packages (from cupy-cuda112) (1.20.3)\n", - "Requirement already satisfied: fastrlock>=0.5 in /home/gbae/.virtualenvs/cucim/lib/python3.8/site-packages (from cupy-cuda112) (0.6)\n", - "\u001b[33mWARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.\n", - "You should consider upgrading via the '/home/gbae/.virtualenvs/cucim/bin/python -m pip install --upgrade pip' command.\u001b[0m\n" - ] - } - ], - "source": [ - "!pip install cupy-cuda112" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}