Kims12 commited on
Commit
0ce6512
β€’
1 Parent(s): 26ae524

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -10,8 +10,12 @@ def apply_filter(image, filter_type, intensity):
10
  if filter_type == "Grayscale":
11
  return convert_to_grayscale(image)
12
  elif filter_type == "Soft Glow":
 
 
 
 
13
  gaussian = cv2.GaussianBlur(image, (15, 15), 0)
14
- soft_glow = cv2.addWeighted(image, 1 - normalized_intensity, gaussian, normalized_intensity, 0)
15
  return soft_glow
16
  elif filter_type == "Portrait Enhancer":
17
  # κΈ°λ³Έ 30% κ°•λ„μ—μ„œ μ‹œμž‘ν•˜μ—¬ μ΅œλŒ€ 100% κ°•λ„κΉŒμ§€ 쑰절
 
10
  if filter_type == "Grayscale":
11
  return convert_to_grayscale(image)
12
  elif filter_type == "Soft Glow":
13
+ # κΈ°λ³Έ 30% κ°•λ„μ—μ„œ μ‹œμž‘ν•˜μ—¬ μ΅œλŒ€ 100% κ°•λ„κΉŒμ§€ 쑰절
14
+ base_intensity = 0.3
15
+ adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
16
+
17
  gaussian = cv2.GaussianBlur(image, (15, 15), 0)
18
+ soft_glow = cv2.addWeighted(image, 1 - adjusted_intensity, gaussian, adjusted_intensity, 0)
19
  return soft_glow
20
  elif filter_type == "Portrait Enhancer":
21
  # κΈ°λ³Έ 30% κ°•λ„μ—μ„œ μ‹œμž‘ν•˜μ—¬ μ΅œλŒ€ 100% κ°•λ„κΉŒμ§€ 쑰절