new add
This commit is contained in:
parent
9744980ede
commit
b62dc1b83f
BIN
demo/kodim08.png
Normal file
BIN
demo/kodim08.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 770 KiB |
6
requirements.txt
Normal file
6
requirements.txt
Normal file
@ -0,0 +1,6 @@
|
||||
torch
|
||||
torchvison
|
||||
matplotlib
|
||||
tqdm
|
||||
numpy
|
||||
fraction
|
||||
13
scripts.py
Normal file
13
scripts.py
Normal file
@ -0,0 +1,13 @@
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
def image_normalization(norm_type):
|
||||
def _inner(tensor: torch.Tensor):
|
||||
if norm_type == 'nomalization':
|
||||
return tensor / 255.0
|
||||
elif norm_type == 'denormalization':
|
||||
return (tensor * 255.0).type(torch.FloatTensor)
|
||||
else:
|
||||
raise Exception('Unknown type of normalization')
|
||||
return _inner
|
||||
Loading…
Reference in New Issue
Block a user