Add files via upload
This commit is contained in:
parent
b37a79f487
commit
8cb973f7b5
2 changed files with 48 additions and 0 deletions
24
4_show.py
Normal file
24
4_show.py
Normal file
|
@ -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)
|
24
4b_show.py
Normal file
24
4b_show.py
Normal file
|
@ -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)
|
Loading…
Reference in a new issue