Spaces:
Runtime error
Runtime error
lappemic
commited on
Commit
·
c2122de
1
Parent(s):
205ea4e
fix box blur
Browse files
app.py
CHANGED
@@ -6,13 +6,13 @@ import kornia as K
|
|
6 |
from kornia.core import Tensor
|
7 |
|
8 |
|
9 |
-
def filters(file,
|
10 |
# load the image using the rust backend
|
11 |
img: Tensor = K.io.load_image(file.name, K.io.ImageLoadType.RGB32)
|
12 |
img = img[None] # 1xCxHxW / fp32 / [0, 1]
|
13 |
|
14 |
# apply tensor image enhancement
|
15 |
-
x_out: Tensor = K.filters.box_blur(img, (int(
|
16 |
x_out = K.filters.blur_pool2d(x_out, float(blur_pool2d))
|
17 |
x_out = K.filters.gaussian_blur2d(x_out, float(gaussian_blur2d))
|
18 |
x_out = K.filters.max_blur_pool2d(x_out, float(max_blur_pool2d))
|
|
|
6 |
from kornia.core import Tensor
|
7 |
|
8 |
|
9 |
+
def filters(file, box_blur, blur_pool2d, gaussian_blur2d, max_blur_pool2d, median_blur):
|
10 |
# load the image using the rust backend
|
11 |
img: Tensor = K.io.load_image(file.name, K.io.ImageLoadType.RGB32)
|
12 |
img = img[None] # 1xCxHxW / fp32 / [0, 1]
|
13 |
|
14 |
# apply tensor image enhancement
|
15 |
+
x_out: Tensor = K.filters.box_blur(img, (int(box_blur), int(box_blur)))
|
16 |
x_out = K.filters.blur_pool2d(x_out, float(blur_pool2d))
|
17 |
x_out = K.filters.gaussian_blur2d(x_out, float(gaussian_blur2d))
|
18 |
x_out = K.filters.max_blur_pool2d(x_out, float(max_blur_pool2d))
|