Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import cv2
|
|
|
4 |
|
5 |
def filter_img(input_img,filter_type):
|
6 |
print('File name is : ',input_img)
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Reading in as JPG format
|
9 |
-
img = cv2.imread(input_img)
|
10 |
|
11 |
filtered_img = np.zeros(img.shape, dtype=int)
|
12 |
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import cv2
|
4 |
+
from PIL import Image, ImageOps
|
5 |
|
6 |
def filter_img(input_img,filter_type):
|
7 |
print('File name is : ',input_img)
|
8 |
|
9 |
+
# Read in image
|
10 |
+
img = Image.open(input_img)
|
11 |
+
# Stop from flipping
|
12 |
+
img = ImageOps.exif_transpose(im)
|
13 |
+
# Convert to numpy array
|
14 |
+
img = np.array(img)
|
15 |
# Reading in as JPG format
|
16 |
+
#img = cv2.imread(input_img)
|
17 |
|
18 |
filtered_img = np.zeros(img.shape, dtype=int)
|
19 |
|