Spaces:
Runtime error
Runtime error
fix double normalization
#2
by
edgarriba
- opened
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from kornia.core import Tensor
|
|
| 7 |
def enhance(file, brightness, contrast, saturation, gamma, hue):
|
| 8 |
# load the image using the rust backend
|
| 9 |
img: Tensor = K.io.load_image(file.name, K.io.ImageLoadType.RGB32)
|
| 10 |
-
img = img[None] /
|
| 11 |
|
| 12 |
# apply tensor image enhancement
|
| 13 |
x_out: Tensor = K.enhance.adjust_brightness(img, float(brightness))
|
|
|
|
| 7 |
def enhance(file, brightness, contrast, saturation, gamma, hue):
|
| 8 |
# load the image using the rust backend
|
| 9 |
img: Tensor = K.io.load_image(file.name, K.io.ImageLoadType.RGB32)
|
| 10 |
+
img = img[None] # 1xCxHxW / fp32 / [0, 1]
|
| 11 |
|
| 12 |
# apply tensor image enhancement
|
| 13 |
x_out: Tensor = K.enhance.adjust_brightness(img, float(brightness))
|