move color print up

This commit is contained in:
Szymon Parafiński 2022-05-18 08:41:12 +02:00
parent 85ba70d8b3
commit 28561eef52
1 changed files with 63 additions and 50 deletions

View File

@ -2,10 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
@ -14,7 +13,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/tq/jq5nwbnj7v10tls99x99qbh40000gn/T/ipykernel_57719/1134982733.py:12: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n",
"/var/folders/8w/3c34c7kd2n144tvm764_pdbw0000gq/T/ipykernel_84713/1134982733.py:12: DeprecationWarning: Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display\n",
" from IPython.core.display import display, HTML\n"
]
},
@ -49,7 +48,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -115,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -158,8 +157,12 @@
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"execution_count": 6,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"def calculate(A):\n",
@ -202,7 +205,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -235,7 +238,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -274,7 +277,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -304,7 +307,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 10,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -338,7 +341,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 11,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -348,12 +351,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7c4a40e6f857407586d21ab113128a97",
"model_id": "5de39e03944b4f70a566d6fd4e0e747e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(Dropdown(description='img_name', options=('cat', 'astro', 'coffee', 'rocket', 'koala', '…"
"interactive(children=(Dropdown(description='img_name', options=('cat', 'astro', 'camera', 'coin', 'clock', 'te…"
]
},
"metadata": {},
@ -365,7 +368,7 @@
"<function __main__.print_matrices(img_name, k)>"
]
},
"execution_count": 22,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@ -376,7 +379,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -386,7 +389,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3533923ce918489eab6fc7de25234078",
"model_id": "a7efd777338d4ccfb3ab75d50a448d13",
"version_major": 2,
"version_minor": 0
},
@ -415,7 +418,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -472,7 +475,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -494,6 +497,22 @@
" plt.imshow(image_reconst)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"def print_color_matrices(img_name,k):\n",
" \"\"\"\n",
" Wyświetlanie macierzy U V S wraz z wymiarami.\n",
" \"\"\"\n",
" image = color_images[img_name]\n",
" original_shape = image.shape\n",
" image_reconst_layers = [compress_svd(image[:,:,i],k)[0] for i in range(3)]\n",
" print(image_reconst_layers)"
]
},
{
"cell_type": "markdown",
"metadata": {
@ -507,7 +526,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 16,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -531,23 +550,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"def print_color_matrices(img_name,k):\n",
" \"\"\"\n",
" Wyświetlanie macierzy U V S wraz z wymiarami.\n",
" \"\"\"\n",
" image = color_images[img_name]\n",
" original_shape = image.shape\n",
" image_reconst_layers = [compress_svd(image[:,:,i],k)[0] for i in range(3)]\n",
" print(image_reconst_layers)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 17,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -557,7 +560,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0af20b426d1240cca1e08e40ede10e98",
"model_id": "51461a1fc1b944a0a967b11590d02c7f",
"version_major": 2,
"version_minor": 0
},
@ -574,7 +577,7 @@
"<function __main__.print_color_matrices(img_name, k)>"
]
},
"execution_count": 15,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@ -585,7 +588,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 18,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -595,7 +598,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "86f500d175554478ac9805075a809d28",
"model_id": "2ac1906f3030426cab0f7d8e8f5be577",
"version_major": 2,
"version_minor": 0
},
@ -635,7 +638,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 19,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -673,7 +676,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 20,
"metadata": {
"pycharm": {
"name": "#%%\n"
@ -697,13 +700,18 @@
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"execution_count": 21,
"metadata": {
"collapsed": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e97ca096507f42b49f98dbb87ac5a2ec",
"model_id": "8c96b6ed413848f2ad0bcf849e6c54d0",
"version_major": 2,
"version_minor": 0
},
@ -721,8 +729,9 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 22,
"metadata": {
"collapsed": true,
"pycharm": {
"name": "#%%\n"
}
@ -731,7 +740,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "71fea739144848d69afb1662172190ad",
"model_id": "00696a30e8374ba2ba4ab98c3ba13a75",
"version_major": 2,
"version_minor": 0
},
@ -750,7 +759,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
@ -771,7 +784,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.8.9"
}
},
"nbformat": 4,