Skip to content

Commit

Permalink
Notebook results
Browse files Browse the repository at this point in the history
  • Loading branch information
kmewhort committed Feb 9, 2023
1 parent 094decf commit f3e660d
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions notebooks/Run All Upscalers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "263e34f7",
"metadata": {
"scrolled": true
Expand All @@ -106,49 +106,56 @@
"name": "stdout",
"output_type": "stream",
"text": [
"None: Avg: 0.01, Warmup iteration: 0.01, 2nd: 0.01, 3rd: 0.01\n",
"Lanczos: Avg: 0.01, Warmup iteration: 0.01, 2nd: 0.01, 3rd: 0.01\n",
"None: Avg: 0.04, Warmup iteration: 0.04, 2nd: 0.04, 3rd: 0.04\n",
"Lanczos: Avg: 0.04, Warmup iteration: 0.04, 2nd: 0.04, 3rd: 0.04\n",
"Nearest: Avg: 0.00, Warmup iteration: 0.00, 2nd: 0.00, 3rd: 0.00\n",
"ESRGAN_4x: Avg: 1.42, Warmup iteration: 1.25, 2nd: 1.58, 3rd: 1.51\n",
"ScuNET: Avg: 0.21, Warmup iteration: 0.29, 2nd: 0.13, 3rd: 0.13\n",
"ScuNET PSNR: Avg: 0.20, Warmup iteration: 0.27, 2nd: 0.13, 3rd: 0.13\n"
"ESRGAN_4x: Avg: 1.40, Warmup iteration: 1.20, 2nd: 1.60, 3rd: 1.41\n",
"ScuNET: Avg: 0.25, Warmup iteration: 0.34, 2nd: 0.16, 3rd: 0.16\n",
"ScuNET PSNR: Avg: 0.23, Warmup iteration: 0.30, 2nd: 0.16, 3rd: 0.16\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.56it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.57it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.60it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.58it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.55it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.56it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.56it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.57it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.56it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.60it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.58it/s]\n"
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n",
"SwinIR tiles: 100%|███████████████████████████████| 9/9 [00:01<00:00, 4.59it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"SwinIR_4x: Avg: 4.65, Warmup iteration: 4.85, 2nd: 4.46, 3rd: 4.78\n"
"SwinIR_4x: Avg: 4.77, Warmup iteration: 5.15, 2nd: 4.40, 3rd: 4.48\n",
"R-ESRGAN General 4xV3: Avg: 2.61, Warmup iteration: 2.45, 2nd: 2.76, 3rd: 4.04\n",
"R-ESRGAN General WDN 4xV3: Avg: 3.08, Warmup iteration: 2.57, 2nd: 3.59, 3rd: 2.64\n",
"R-ESRGAN AnimeVideo: Avg: 2.12, Warmup iteration: 1.22, 2nd: 3.03, 3rd: 2.51\n",
"R-ESRGAN 4x+: Avg: 2.67, Warmup iteration: 2.85, 2nd: 2.48, 3rd: 1.78\n",
"R-ESRGAN 4x+ Anime6B: Avg: 2.67, Warmup iteration: 2.99, 2nd: 2.35, 3rd: 3.96\n",
"R-ESRGAN 2x+: Avg: 2.60, Warmup iteration: 1.71, 2nd: 3.50, 3rd: 3.45\n"
]
}
],
"source": [
"# try all the upscalers!\n",
"scale_factor = 2.0\n",
"scale_factor = 4.0\n",
"for upscaler_name in available_models():\n",
" clear_on_device_caches()\n",
" timings = [] \n",
" timings = [] \n",
" result = None \n",
" for i in range(0,10):\n",
" start = timer() \n",
" upscale(upscaler_name, image, scale_factor)\n",
" result = upscale(upscaler_name, image, scale_factor)\n",
" timings.append(timer() - start)\n",
"\n",
" result.save(f\"./results/{upscaler_name}.png\")\n",
" # other than first iteration \n",
" mean_time = sum(timings[1::-1]) / len(timings[1::-1]) \n",
" print(f\"{upscaler_name}: Avg: {mean_time:.2f}, Warmup iteration: {timings[0]:.2f}, 2nd: {timings[1]:.2f}, 3rd: {timings[2]:.2f}\")\n",
Expand Down
Binary file added notebooks/results/ESRGAN_4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/Lanczos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/Nearest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/None.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN 2x+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN 4x+ Anime6B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN 4x+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN AnimeVideo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN General 4xV3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/R-ESRGAN General WDN 4xV3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/ScuNET PSNR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/ScuNET.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/results/SwinIR_4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f3e660d

Please sign in to comment.