From 8cb973f7b50f9896ac73bf9a51e62ecb75f981c1 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:04:09 +0200 Subject: [PATCH] Add files via upload --- 4_show.py | 24 ++++++++++++++++++++++++ 4b_show.py | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 4_show.py create mode 100644 4b_show.py diff --git a/4_show.py b/4_show.py new file mode 100644 index 0000000..7276dd6 --- /dev/null +++ b/4_show.py @@ -0,0 +1,24 @@ +import numpy as np +import torch +from Anime import Anime + +# Convert from avi to npy +filename: str = "example_data_crop" + + +torch_device: torch.device = torch.device( + "cuda:0" if torch.cuda.is_available() else "cpu" +) + +print("Load data") +input = np.load(filename + str("_decorrelated.npy")) +data = torch.tensor(input, device=torch_device) +del input +print("loading done") + +data = data.nan_to_num(nan=0.0) +#data -= data.min(dim=0, keepdim=True)[0] + + +ani = Anime() +ani.show(data, vmin=0.0) diff --git a/4b_show.py b/4b_show.py new file mode 100644 index 0000000..82c070d --- /dev/null +++ b/4b_show.py @@ -0,0 +1,24 @@ +import numpy as np +import torch +from Anime import Anime + +# Convert from avi to npy +filename: str = "example_data_crop" + + +torch_device: torch.device = torch.device( + "cuda:0" if torch.cuda.is_available() else "cpu" +) + +print("Load data") +input = np.load(filename + str("_decorrelated.npy")) +data = torch.tensor(input, device=torch_device) +del input +print("loading done") + +data = data.nan_to_num(nan=0.0) +data -= data.min(dim=0, keepdim=True)[0] +data *= data.std(dim=0, keepdim=True) + +ani = Anime() +ani.show(data)