Spaces:
Runtime error
Runtime error
maduvantha
commited on
Commit
•
d0580f5
1
Parent(s):
b46216d
Update augmentation.py
Browse files- augmentation.py +2 -2
augmentation.py
CHANGED
@@ -9,7 +9,7 @@ import numpy as np
|
|
9 |
import PIL
|
10 |
|
11 |
from skimage.transform import resize, rotate
|
12 |
-
|
13 |
import torchvision
|
14 |
|
15 |
import warnings
|
@@ -36,7 +36,7 @@ def pad_clip(clip, h, w):
|
|
36 |
pad_h = (0, 0) if h < im_h else ((h - im_h) // 2, (h - im_h + 1) // 2)
|
37 |
pad_w = (0, 0) if w < im_w else ((w - im_w) // 2, (w - im_w + 1) // 2)
|
38 |
|
39 |
-
return pad(clip, ((0, 0), pad_h, pad_w, (0, 0)), mode='edge')
|
40 |
|
41 |
|
42 |
def resize_clip(clip, size, interpolation='bilinear'):
|
|
|
9 |
import PIL
|
10 |
|
11 |
from skimage.transform import resize, rotate
|
12 |
+
|
13 |
import torchvision
|
14 |
|
15 |
import warnings
|
|
|
36 |
pad_h = (0, 0) if h < im_h else ((h - im_h) // 2, (h - im_h + 1) // 2)
|
37 |
pad_w = (0, 0) if w < im_w else ((w - im_w) // 2, (w - im_w + 1) // 2)
|
38 |
|
39 |
+
return np.pad(clip, ((0, 0), pad_h, pad_w, (0, 0)), mode='edge')
|
40 |
|
41 |
|
42 |
def resize_clip(clip, size, interpolation='bilinear'):
|