Spaces:
Runtime error
Runtime error
Update filters.py
Browse files- filters.py +0 -4
filters.py
CHANGED
@@ -5,13 +5,11 @@ import streamlit as st
|
|
5 |
|
6 |
# Refer to the application notebook implement the following filters
|
7 |
|
8 |
-
@st.cache_data
|
9 |
def bw_filter(img):
|
10 |
# Write your code here to convert img to a gray image
|
11 |
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
12 |
return img_gray
|
13 |
|
14 |
-
@st.cache_data
|
15 |
def vignette(img, level=2):
|
16 |
# Write your code here to create the vignette effect
|
17 |
height, width = img.shape[:2]
|
@@ -34,7 +32,6 @@ def vignette(img, level=2):
|
|
34 |
|
35 |
return img_vignette
|
36 |
|
37 |
-
@st.cache_data
|
38 |
def sepia(img):
|
39 |
# Write your code here to create the sepia effect
|
40 |
img_sepia = img.copy()
|
@@ -50,7 +47,6 @@ def sepia(img):
|
|
50 |
img_sepia = cv2.cvtColor(img_sepia, cv2.COLOR_RGB2BGR)
|
51 |
return img_sepia
|
52 |
|
53 |
-
@st.cache_data
|
54 |
def pencil_sketch(img, ksize=5):
|
55 |
# Write your code here to create the pencil sketch effect
|
56 |
img_blur = cv2.GaussianBlur(img, (ksize, ksize), 0, 0)
|
|
|
5 |
|
6 |
# Refer to the application notebook implement the following filters
|
7 |
|
|
|
8 |
def bw_filter(img):
|
9 |
# Write your code here to convert img to a gray image
|
10 |
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
11 |
return img_gray
|
12 |
|
|
|
13 |
def vignette(img, level=2):
|
14 |
# Write your code here to create the vignette effect
|
15 |
height, width = img.shape[:2]
|
|
|
32 |
|
33 |
return img_vignette
|
34 |
|
|
|
35 |
def sepia(img):
|
36 |
# Write your code here to create the sepia effect
|
37 |
img_sepia = img.copy()
|
|
|
47 |
img_sepia = cv2.cvtColor(img_sepia, cv2.COLOR_RGB2BGR)
|
48 |
return img_sepia
|
49 |
|
|
|
50 |
def pencil_sketch(img, ksize=5):
|
51 |
# Write your code here to create the pencil sketch effect
|
52 |
img_blur = cv2.GaussianBlur(img, (ksize, ksize), 0, 0)
|