diff --git a/notebooks/qrcode-monster/qrcode-monster.ipynb b/notebooks/qrcode-monster/qrcode-monster.ipynb index 3ebf65ffe5a..1029414cb03 100644 --- a/notebooks/qrcode-monster/qrcode-monster.ipynb +++ b/notebooks/qrcode-monster/qrcode-monster.ipynb @@ -83,9 +83,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2024-12-05 09:21:58.637418: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n", + "2024-12-05 09:21:58.649752: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:477] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n", + "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", + "E0000 00:00:1733376118.663808 222102 cuda_dnn.cc:8310] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n", + "E0000 00:00:1733376118.667978 222102 cuda_blas.cc:1418] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", + "2024-12-05 09:21:58.683751: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", + "To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d2ae2c338f75482c8083abafc9dc3be6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Loading pipeline components...: 0%| | 0/7 [00:00" ] @@ -1008,7 +1056,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ae60b4be54ea461c8d3035a1078a571d", + "model_id": "ec68400d837143958ed73d401d47e9c3", "version_major": 2, "version_minor": 0 }, @@ -1046,10 +1094,11 @@ "# Fetch `skip_kernel_extension` module\n", "import requests\n", "\n", - "r = requests.get(\n", - " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/skip_kernel_extension.py\",\n", - ")\n", - "open(\"skip_kernel_extension.py\", \"w\").write(r.text)\n", + "if not Path(\"skip_kernel_extension.py\").exists():\n", + " r = requests.get(\n", + " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/skip_kernel_extension.py\",\n", + " )\n", + " open(\"skip_kernel_extension.py\", \"w\").write(r.text)\n", "\n", "int8_pipe = None\n", "\n", @@ -1070,7 +1119,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -1113,7 +1162,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 16, "metadata": { "test_replace": { "num_inference_steps = 25": "num_inference_steps = 1" @@ -1170,36 +1219,13 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 17, "metadata": { "test_replace": { "subset_size = 200": "subset_size = 8" } }, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "df3e1cb5c3f440c689e286070ab531bf", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - " 0%| | 0/100 [00:00" ] @@ -1407,8 +1452,8 @@ "output_type": "stream", "text": [ "FP16 UNet size: 1639.41 MB\n", - "INT8 UNet size: 820.96 MB\n", - "UNet compression rate: 1.997\n" + "INT8 UNet size: 821.79 MB\n", + "UNet compression rate: 1.995\n" ] } ], @@ -1433,8 +1478,8 @@ "output_type": "stream", "text": [ "FP16 ControlNet size: 689.09 MB\n", - "INT8 ControlNet size: 345.14 MB\n", - "ControlNet compression rate: 1.997\n" + "INT8 ControlNet size: 345.55 MB\n", + "ControlNet compression rate: 1.994\n" ] } ], @@ -1464,7 +1509,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -1488,16 +1533,26 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 27, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/ea/work/py311/lib/python3.11/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `controlnet` directly via 'OVContrlNetStableDiffusionPipeline' object attribute is deprecated. Please access 'controlnet' over 'OVContrlNetStableDiffusionPipeline's config object instead, e.g. 'scheduler.config.controlnet'.\n", + " deprecate(\"direct config name access\", \"1.0.0\", deprecation_message, standard_warn=False)\n", + "/home/ea/work/py311/lib/python3.11/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `unet` directly via 'OVContrlNetStableDiffusionPipeline' object attribute is deprecated. Please access 'unet' over 'OVContrlNetStableDiffusionPipeline's config object instead, e.g. 'scheduler.config.unet'.\n", + " deprecate(\"direct config name access\", \"1.0.0\", deprecation_message, standard_warn=False)\n" + ] + }, { "name": "stdout", "output_type": "stream", "text": [ - "FP16 pipeline: 190.245 seconds\n", - "INT8 pipeline: 166.540 seconds\n", - "Performance speed up: 1.142\n" + "FP16 pipeline: 176.250 seconds\n", + "INT8 pipeline: 119.885 seconds\n", + "Performance speed up: 1.470\n" ] } ], @@ -1526,13 +1581,13 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "f304986daf7545e48fbf746f89185a17", + "model_id": "aae98eae136c45d380781df9a5930502", "version_major": 2, "version_minor": 0 }, @@ -1540,7 +1595,7 @@ "Checkbox(value=True, description='Use quantized model')" ] }, - "execution_count": 49, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1561,7 +1616,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -1615,16 +1670,6 @@ "# EXAMPLE: `demo.launch(server_name='your server name', server_port='server port in int')`\n", "# To learn more please refer to the Gradio docs: https://gradio.app/docs/" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# please uncomment and run this cell for stopping gradio interface\n", - "# demo.close()" - ] } ], "metadata": { @@ -1643,7 +1688,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.11.4" }, "openvino_notebooks": { "imageUrl": "https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/notebooks/qrcode-monster/qrcode-monster.png?raw=true", @@ -1663,7 +1708,186 @@ }, "widgets": { "application/vnd.jupyter.widget-state+json": { - "state": {}, + "state": { + "1bef708056884383943f5f658b9a53cb": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "1ce2560752a64910af7d8c0c3d4d48e7": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLStyleModel", + "state": { + "description_width": "", + "font_size": null, + "text_color": null + } + }, + "2937437991224ecea00a45aacaa6ecd1": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLModel", + "state": { + "layout": "IPY_MODEL_c67ef351ed62420cab2f337e5b45e7c4", + "style": "IPY_MODEL_cf5264c5f7754288b6e84c8d70423399", + "value": "Loading pipeline components...: 100%" + } + }, + "301ae10490414e97841640d32d794f4a": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "354ee07385054f14b26dd15695f9b906": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "CheckboxStyleModel", + "state": { + "description_width": "" + } + }, + "5080afd396be402c82d1de8d9888df2f": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "51cd647d5166497593c5ba6289b9b4c6": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "5de66236e6754dd3a71a8d04f07d30af": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "FloatProgressModel", + "state": { + "bar_style": "success", + "layout": "IPY_MODEL_fdc3cbcaa1f247d98246e74b48ee5d81", + "max": 7, + "style": "IPY_MODEL_646268249a354182a7614a26796c0bf2", + "value": 7 + } + }, + "646268249a354182a7614a26796c0bf2": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ProgressStyleModel", + "state": { + "description_width": "" + } + }, + "69044134845840aabeac11136eaaf33f": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "86517f0ecd134229acad690ac5dbe17c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLModel", + "state": { + "layout": "IPY_MODEL_69044134845840aabeac11136eaaf33f", + "style": "IPY_MODEL_1ce2560752a64910af7d8c0c3d4d48e7", + "value": " 7/7 [00:01<00:00,  4.52it/s]" + } + }, + "aae98eae136c45d380781df9a5930502": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "CheckboxModel", + "state": { + "description": "Use quantized model", + "disabled": false, + "layout": "IPY_MODEL_5080afd396be402c82d1de8d9888df2f", + "style": "IPY_MODEL_354ee07385054f14b26dd15695f9b906", + "value": true + } + }, + "c67ef351ed62420cab2f337e5b45e7c4": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "cf5264c5f7754288b6e84c8d70423399": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLStyleModel", + "state": { + "description_width": "", + "font_size": null, + "text_color": null + } + }, + "cf6df2b5ed224518b7b979b701d910dc": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "DescriptionStyleModel", + "state": { + "description_width": "" + } + }, + "d2ae2c338f75482c8083abafc9dc3be6": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HBoxModel", + "state": { + "children": [ + "IPY_MODEL_2937437991224ecea00a45aacaa6ecd1", + "IPY_MODEL_5de66236e6754dd3a71a8d04f07d30af", + "IPY_MODEL_86517f0ecd134229acad690ac5dbe17c" + ], + "layout": "IPY_MODEL_51cd647d5166497593c5ba6289b9b4c6" + } + }, + "d81fd2c2fb674a498475618c37d55d35": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "DropdownModel", + "state": { + "_options_labels": [ + "CPU", + "AUTO" + ], + "description": "Device:", + "index": 1, + "layout": "IPY_MODEL_301ae10490414e97841640d32d794f4a", + "style": "IPY_MODEL_cf6df2b5ed224518b7b979b701d910dc" + } + }, + "ea11d9080f8e4b9caaaa4c5bb7f4b45d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "CheckboxStyleModel", + "state": { + "description_width": "" + } + }, + "ec68400d837143958ed73d401d47e9c3": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "CheckboxModel", + "state": { + "description": "Quantization", + "disabled": false, + "layout": "IPY_MODEL_1bef708056884383943f5f658b9a53cb", + "style": "IPY_MODEL_ea11d9080f8e4b9caaaa4c5bb7f4b45d", + "value": true + } + }, + "fdc3cbcaa1f247d98246e74b48ee5d81": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + } + }, "version_major": 2, "version_minor": 0 }