From 0b14cd689bebcbbb461cf73c3222a770ad2a78a9 Mon Sep 17 00:00:00 2001 From: Felix Divo <4403130+felixdivo@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:05:55 +0200 Subject: [PATCH] Update raw_pose_processing.ipynb Fix an error where a directory was missing Allow to seamlessly take up interrupted work --- raw_pose_processing.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/raw_pose_processing.ipynb b/raw_pose_processing.ipynb index de47f1b..e5577ea 100644 --- a/raw_pose_processing.ipynb +++ b/raw_pose_processing.ipynb @@ -19,6 +19,7 @@ "%matplotlib inline\n", "\n", "import sys, os\n", + "from pathlib import Path\n", "import torch\n", "import numpy as np\n", "import matplotlib\n", @@ -253,7 +254,8 @@ " for path in pbar:\n", " save_path = path.replace('./amass_data', './pose_data')\n", " save_path = save_path[:-3] + 'npy'\n", - " fps = amass_to_pose(path, save_path)\n", + " if not Path(save_path).exists(): # Allow to resume work\n", + " fps = amass_to_pose(path, save_path)\n", " \n", " cur_count += len(paths)\n", " print('Processed / All (fps %d): %d/%d'% (fps, cur_count, all_count) )\n", @@ -328,7 +330,8 @@ "save_dir = './joints'\n", "index_file = pd.read_csv(index_path)\n", "total_amount = index_file.shape[0]\n", - "fps = 20" + "fps = 20\n", + "Path(save_dir).mkdir(exist_ok=True)" ] }, {