jflo commited on
Commit
6246395
1 Parent(s): 60f810a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -20,7 +20,9 @@ def filter_img(input_img,filter_type):
20
  [0.349, 0.686, 0.168],
21
  [0.272, 0.534, 0.131]])
22
 
23
- filtered_img = np.dot(img, sepia_filter.T).astype(np.uint8)
 
 
24
  elif filter_type == 'Gray-sharp':
25
  img = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
26
  filtered_img = cv2.addWeighted(img,4, cv2.blur(img,(128,128)),-4,128)
 
20
  [0.349, 0.686, 0.168],
21
  [0.272, 0.534, 0.131]])
22
 
23
+ filtered_img = np.dot(img, sepia_filter.T)
24
+ filtered_img = (filtered_img / filtered_img.max() * 255).astype(np.uint8)
25
+
26
  elif filter_type == 'Gray-sharp':
27
  img = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
28
  filtered_img = cv2.addWeighted(img,4, cv2.blur(img,(128,128)),-4,128)