From 4c0b9d63ecd1785164a3047cdfdd69da8ea7ce98 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:58:15 +0200 Subject: [PATCH] Update run_svd.py --- run_svd.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/run_svd.py b/run_svd.py index aaa7b50..d4eee5f 100644 --- a/run_svd.py +++ b/run_svd.py @@ -82,6 +82,17 @@ if __name__ == "__main__": print("Calculate to_remove") data = torch.tensor(input, device=torch_device) + + for id in range(0, data.shape[0]): + data[id, ...] = tv.transforms.functional.affine( + img=data[id, ...].unsqueeze(0), + angle=0, + translate=[tvec[id, 1], tvec[id, 0]], + scale=1.0, + shear=0, + fill=fill_value, + ).squeeze(0) + to_remove_data = to_remove(data, whiten_k, whiten_mean) data -= to_remove_data