mischeiwiller commited on
Commit
27a55e9
·
verified ·
1 Parent(s): 6edb6be

fix: add `float()`conversions to enhance function

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -14,11 +14,11 @@ def enhance(image, brightness, contrast, saturation, gamma, hue):
14
  img = img.unsqueeze(0) # 1xCxHxW / fp32 / [0, 1]
15
 
16
  # apply tensor image enhancement
17
- x_out: Tensor = K.enhance.adjust_brightness(img, brightness)
18
- x_out = K.enhance.adjust_contrast(x_out, contrast)
19
- x_out = K.enhance.adjust_saturation(x_out, saturation)
20
- x_out = K.enhance.adjust_gamma(x_out, gamma)
21
- x_out = K.enhance.adjust_hue(x_out, hue)
22
 
23
  return K.utils.tensor_to_image(x_out.squeeze())
24
 
 
14
  img = img.unsqueeze(0) # 1xCxHxW / fp32 / [0, 1]
15
 
16
  # apply tensor image enhancement
17
+ x_out: Tensor = K.enhance.adjust_brightness(img, float(brightness))
18
+ x_out = K.enhance.adjust_contrast(x_out, float(contrast))
19
+ x_out = K.enhance.adjust_saturation(x_out, float(saturation))
20
+ x_out = K.enhance.adjust_gamma(x_out, float(gamma))
21
+ x_out = K.enhance.adjust_hue(x_out, float(hue))
22
 
23
  return K.utils.tensor_to_image(x_out.squeeze())
24