From 04cae60039c2dcdd1b920f7882a24dc6a674f7b5 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Wed, 3 Feb 2021 15:41:13 +0100 Subject: [PATCH] fix initialization --- monoloco/prep/preprocess_ki.py | 2 +- monoloco/train/trainer.py | 2 +- monoloco/utils/misc.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/monoloco/prep/preprocess_ki.py b/monoloco/prep/preprocess_ki.py index eed1bf0..6576e19 100644 --- a/monoloco/prep/preprocess_ki.py +++ b/monoloco/prep/preprocess_ki.py @@ -84,7 +84,7 @@ class PreprocessKitti: boxes, keypoints = preprocess_pifpaf(annotations, im_size=(1238, 374)) keypoints_hflip = transform_keypoints(keypoints, mode='flip') inputs = preprocess_monoloco(keypoints, kk).tolist() - inputs_hflip = preprocess_monoloco(keypoints, kk).tolist() + inputs_hflip = preprocess_monoloco(keypoints_hflip, kk).tolist() all_keypoints = [keypoints, keypoints_hflip] all_inputs = [inputs, inputs_hflip] diff --git a/monoloco/train/trainer.py b/monoloco/train/trainer.py index 481c7af..a72439e 100644 --- a/monoloco/train/trainer.py +++ b/monoloco/train/trainer.py @@ -125,7 +125,7 @@ class Trainer: best_model_wts = copy.deepcopy(self.model.state_dict()) best_acc = 1e6 best_epoch = 0 - epoch_losses_tr = epoch_losses_val = epoch_norms = epoch_sis = [] + epoch_losses_tr, epoch_losses_val, epoch_norms, epoch_sis = [], [], [], [] for epoch in range(self.num_epochs): diff --git a/monoloco/utils/misc.py b/monoloco/utils/misc.py index e0fc39a..020d243 100644 --- a/monoloco/utils/misc.py +++ b/monoloco/utils/misc.py @@ -1,5 +1,6 @@ import json + def append_cluster(dic_jo, phase, xx, dd, kps): """Append the annotation based on its distance"""