Commit f9fcad05 authored by Gabriele Franch's avatar Gabriele Franch
Browse files

fixed padding to use args

parent b063723d
...@@ -42,7 +42,7 @@ def padding_taasss(array: np.ndarray, args) -> np.ndarray: ...@@ -42,7 +42,7 @@ def padding_taasss(array: np.ndarray, args) -> np.ndarray:
to to
(1, 25, 480, 480, 1) (1, 25, 480, 480, 1)
""" """
zeros = np.zeros((args.batch_size, 25, args.img_width, args.img_width, 1)) zeros = np.zeros((args.batch_size, args.total_length, args.img_width, args.img_width, args.img_channel))
if args.img_width == 512: if args.img_width == 512:
zeros[:, :, 16:496, 16:496, :] = array zeros[:, :, 16:496, 16:496, :] = array
elif args.img_width == 256: elif args.img_width == 256:
...@@ -66,6 +66,8 @@ def unpadding_taasss(array: np.ndarray, args) -> np.ndarray: ...@@ -66,6 +66,8 @@ def unpadding_taasss(array: np.ndarray, args) -> np.ndarray:
elif args.img_width == 128: elif args.img_width == 128:
return array[:, :, 4:124, 4:124, :] return array[:, :, 4:124, 4:124, :]
raise ValueError raise ValueError
def change_taasss_dims(a: np.ndarray) -> np.ndarray: def change_taasss_dims(a: np.ndarray) -> np.ndarray:
"""(25, 1, 1, 480, 480) to (1, 25, 480, 480, 1)""" """(25, 1, 1, 480, 480) to (1, 25, 480, 480, 1)"""
a = np.squeeze(a) a = np.squeeze(a)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment