Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timing code for SSIM and CW-SSIM #38

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions SSIM_CW-SSIM_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"import time\n",
"import numpy as np\n",
"\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -198,13 +199,16 @@
}
],
"source": [
"start = time.time()\n",
"ssim_rot = SSIM(im, gaussian_kernel_1d).ssim_value(im_rot)\n",
"ssim_lig = SSIM(im, gaussian_kernel_1d).ssim_value(im_lig)\n",
"ssim_cro = SSIM(im, gaussian_kernel_1d).ssim_value(im_cro)\n",
"end = time.time()\n",
"\n",
"print(\"SSIM of rotated image %.4f\" % ssim_rot)\n",
"print(\"SSIM of modified lighting image %.4f\" % ssim_lig)\n",
"print(\"SSIM of cropped image %.4f\" % ssim_cro)"
"print(\"SSIM of cropped image %.4f\" % ssim_cro)\n",
"print(\"Elapsed time of SSIM is %.6fs\" % (end - start))"
]
},
{
Expand All @@ -225,13 +229,16 @@
}
],
"source": [
"start = time.time()\n",
"cw_ssim_rot = SSIM(im).cw_ssim_value(im_rot)\n",
"cw_ssim_lig = SSIM(im).cw_ssim_value(im_lig)\n",
"cw_ssim_cro = SSIM(im).cw_ssim_value(im_cro)\n",
"end = time.time()\n",
"\n",
"print(\"CW-SSIM of rotated image %.4f\" % cw_ssim_rot)\n",
"print(\"CW-SSIM of modified lighting image %.4f\" % cw_ssim_lig)\n",
"print(\"CW-SSIM of cropped image %.4f\" % cw_ssim_cro)"
"print(\"CW-SSIM of cropped image %.4f\" % cw_ssim_cro)\n",
"print(\"Elapsed time of CW-SSIM is %.6fs\" % (end - start))"
]
}
],
Expand Down