Kims12 commited on
Commit
8a91ef2
β€’
1 Parent(s): 0ce6512

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,16 +10,16 @@ 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
- # κΈ°λ³Έ 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% κ°•λ„κΉŒμ§€ 쑰절
22
- base_intensity = 0.3
23
  adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
24
 
25
  image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
 
10
  if filter_type == "Grayscale":
11
  return convert_to_grayscale(image)
12
  elif filter_type == "Soft Glow":
13
+ # κΈ°λ³Έ 10% κ°•λ„μ—μ„œ μ‹œμž‘ν•˜μ—¬ μ΅œλŒ€ 100% κ°•λ„κΉŒμ§€ 쑰절
14
+ base_intensity = 0.1
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
+ # κΈ°λ³Έ 50% κ°•λ„μ—μ„œ μ‹œμž‘ν•˜μ—¬ μ΅œλŒ€ 100% κ°•λ„κΉŒμ§€ 쑰절
22
+ base_intensity = 0.5
23
  adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
24
 
25
  image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))