From 3235e9d138d31ad1c80407e128cb7b4ca64d34bd Mon Sep 17 00:00:00 2001 From: lorenzo Date: Mon, 13 May 2019 13:55:57 +0200 Subject: [PATCH] fix names of splits --- README.md | 3 ++- src/eval/run_kitti.py | 4 ++-- src/features/preprocess_ki.py | 6 +++--- src/features/preprocess_nu.py | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d63a8d7..89496cd 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,8 @@ data/kitti/images` Download nuScenes dataset (any version: Mini, Teaser or TrainVal) from [nuScenes](https://www.nuscenes.org/download), save it anywhere and soft link it in `data/nuscenes` - +### 3) Train Val Splits +Fo ### Input joints for training MonoLoco is trained using 2D human pose joints detected by pifpaf and matched with the ground truth location provided by diff --git a/src/eval/run_kitti.py b/src/eval/run_kitti.py index 79d1b07..e71955d 100644 --- a/src/eval/run_kitti.py +++ b/src/eval/run_kitti.py @@ -23,8 +23,8 @@ class RunKitti: self.n_samples = 100 list_ann = glob.glob(os.path.join(dir_ann, '*.json')) - self.dir_kk = os.path.join('data', 'baselines', 'calib') - self.dir_out = os.path.join('data', 'baselines', 'monoloco') + self.dir_kk = os.path.join('data', 'kitti', 'calib') + self.dir_out = os.path.join('data', 'kitti', 'monoloco') if not os.path.exists(self.dir_out): os.makedirs(self.dir_out) print("Created output directory for txt files") diff --git a/src/features/preprocess_ki.py b/src/features/preprocess_ki.py index fadead9..208d79e 100644 --- a/src/features/preprocess_ki.py +++ b/src/features/preprocess_ki.py @@ -17,7 +17,7 @@ class PreprocessKitti: self.iou_thresh = iou_thresh self.dir_gt = os.path.join('data', 'kitti', 'gt') self.names_gt = os.listdir(self.dir_gt) - self.dir_kk = os.path.join('data', 'baselines', 'calib') + self.dir_kk = os.path.join('data', 'kitti', 'calib') self.list_gt = glob.glob(self.dir_gt + '/*.txt') assert os.path.exists(self.dir_gt), "Ground truth dir does not exist" assert os.path.exists(self.dir_ann), "Annotation dir does not exist" @@ -27,8 +27,8 @@ class PreprocessKitti: dir_out = os.path.join('data', 'arrays') self.path_joints = os.path.join(dir_out, 'joints-kitti-' + now_time + '.json') self.path_names = os.path.join(dir_out, 'names-kitti-' + now_time + '.json') - path_train = os.path.join('data', 'baselines', 'train.txt') - path_val = os.path.join('data', 'baselines', 'val.txt') + path_train = os.path.join('splits', 'kitti_train.txt') + path_val = os.path.join('splits', 'kitti_val.txt') logging.basicConfig(level=logging.INFO) self.logger = logging.getLogger(__name__) diff --git a/src/features/preprocess_nu.py b/src/features/preprocess_nu.py index 0a97ea5..8da959c 100644 --- a/src/features/preprocess_nu.py +++ b/src/features/preprocess_nu.py @@ -73,11 +73,11 @@ class PreprocessNuscenes: elif dataset == 'nuscenes_teaser': self.nusc = NuScenes(version='v1.0-trainval', dataroot=dir_nuscenes, verbose=True) - with open("data/baselines/teaser_scenes.txt", "r") as ff: + with open("splits/nuscenes_teaser_scenes.txt", "r") as ff: teaser_scenes = ff.read().splitlines() self.scenes = self.nusc.scene self.scenes = [scene for scene in self.scenes if scene['token'] in teaser_scenes] - with open("data/baselines/split_teaser_scenes.json", "r") as ff: + with open("data/splits/split_nuscenes_teaser.json", "r") as ff: dic_split = json.load(ff) self.split_train = [scene['name'] for scene in self.scenes if scene['token'] in dic_split['train']] self.split_val = [scene['name'] for scene in self.scenes if scene['token'] in dic_split['val']]