From 48672e6e3a04498923e8132ff51b545dc669f026 Mon Sep 17 00:00:00 2001 From: David Marx Date: Sat, 8 Oct 2022 20:35:50 -0700 Subject: [PATCH] add prefetch --- Video_Killed_The_Radio_Star_Defusion.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Video_Killed_The_Radio_Star_Defusion.ipynb b/Video_Killed_The_Radio_Star_Defusion.ipynb index 3800320..9c8a024 100644 --- a/Video_Killed_The_Radio_Star_Defusion.ipynb +++ b/Video_Killed_The_Radio_Star_Defusion.ipynb @@ -1029,6 +1029,7 @@ "from subprocess import Popen, PIPE\n", "\n", "from omegaconf import OmegaConf\n", + "from prefetch import background\n", "from tqdm.autonotebook import tqdm\n", "\n", "from vktrs.tsp import (\n", @@ -1087,6 +1088,7 @@ "#####################################\n", "\n", "# helper function for readability\n", + "@background(max_prefetch=-1)\n", "def process_sequence(idx):\n", " im_paths = get_image_sequence(idx, root)\n", " images = [Image.open(fp) for fp in im_paths]\n",