diff --git a/notebooks/Run All Upscalers.ipynb b/notebooks/Run All Upscalers.ipynb index ce24b87..6cb3fc0 100644 --- a/notebooks/Run All Upscalers.ipynb +++ b/notebooks/Run All Upscalers.ipynb @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "263e34f7", "metadata": { "scrolled": true @@ -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", diff --git a/notebooks/results/ESRGAN_4x.png b/notebooks/results/ESRGAN_4x.png new file mode 100644 index 0000000..6153cbc Binary files /dev/null and b/notebooks/results/ESRGAN_4x.png differ diff --git a/notebooks/results/Lanczos.png b/notebooks/results/Lanczos.png new file mode 100644 index 0000000..5c51e48 Binary files /dev/null and b/notebooks/results/Lanczos.png differ diff --git a/notebooks/results/Nearest.png b/notebooks/results/Nearest.png new file mode 100644 index 0000000..a2daf10 Binary files /dev/null and b/notebooks/results/Nearest.png differ diff --git a/notebooks/results/None.png b/notebooks/results/None.png new file mode 100644 index 0000000..5c51e48 Binary files /dev/null and b/notebooks/results/None.png differ diff --git a/notebooks/results/R-ESRGAN 2x+.png b/notebooks/results/R-ESRGAN 2x+.png new file mode 100644 index 0000000..0d432c5 Binary files /dev/null and b/notebooks/results/R-ESRGAN 2x+.png differ diff --git a/notebooks/results/R-ESRGAN 4x+ Anime6B.png b/notebooks/results/R-ESRGAN 4x+ Anime6B.png new file mode 100644 index 0000000..7dbcc36 Binary files /dev/null and b/notebooks/results/R-ESRGAN 4x+ Anime6B.png differ diff --git a/notebooks/results/R-ESRGAN 4x+.png b/notebooks/results/R-ESRGAN 4x+.png new file mode 100644 index 0000000..73254a4 Binary files /dev/null and b/notebooks/results/R-ESRGAN 4x+.png differ diff --git a/notebooks/results/R-ESRGAN AnimeVideo.png b/notebooks/results/R-ESRGAN AnimeVideo.png new file mode 100644 index 0000000..de1f73e Binary files /dev/null and b/notebooks/results/R-ESRGAN AnimeVideo.png differ diff --git a/notebooks/results/R-ESRGAN General 4xV3.png b/notebooks/results/R-ESRGAN General 4xV3.png new file mode 100644 index 0000000..11464f5 Binary files /dev/null and b/notebooks/results/R-ESRGAN General 4xV3.png differ diff --git a/notebooks/results/R-ESRGAN General WDN 4xV3.png b/notebooks/results/R-ESRGAN General WDN 4xV3.png new file mode 100644 index 0000000..6aa79d4 Binary files /dev/null and b/notebooks/results/R-ESRGAN General WDN 4xV3.png differ diff --git a/notebooks/results/ScuNET PSNR.png b/notebooks/results/ScuNET PSNR.png new file mode 100644 index 0000000..a992fc5 Binary files /dev/null and b/notebooks/results/ScuNET PSNR.png differ diff --git a/notebooks/results/ScuNET.png b/notebooks/results/ScuNET.png new file mode 100644 index 0000000..a992fc5 Binary files /dev/null and b/notebooks/results/ScuNET.png differ diff --git a/notebooks/results/SwinIR_4x.png b/notebooks/results/SwinIR_4x.png new file mode 100644 index 0000000..f610657 Binary files /dev/null and b/notebooks/results/SwinIR_4x.png differ