Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,4 @@
|
|
1 |
import streamlit as st
|
2 |
-
import seaborn as sns
|
3 |
-
import matplotlib.pyplot as plt
|
4 |
-
import os, random
|
5 |
import cv2
|
6 |
from tensorflow.keras.models import load_model
|
7 |
from PIL import Image
|
@@ -12,7 +9,7 @@ model = load_model('sudoku_net.h5')
|
|
12 |
|
13 |
def preprocess(image):
|
14 |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
15 |
-
|
16 |
blur = cv2.bilateralFilter(gray,9,75,75)
|
17 |
threshold_img = cv2.adaptiveThreshold(blur,255,1,1,11,2)
|
18 |
return threshold_img
|
@@ -173,6 +170,7 @@ def main():
|
|
173 |
puzzle = Image.open(uploaded_file)
|
174 |
col1.image(puzzle, use_column_width=True)
|
175 |
puzzle = np.asarray(puzzle)
|
|
|
176 |
# Resizing puzzle to be solved
|
177 |
puzzle = cv2.resize(puzzle, (450,450))
|
178 |
# Preprocessing Puzzle
|
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
2 |
import cv2
|
3 |
from tensorflow.keras.models import load_model
|
4 |
from PIL import Image
|
|
|
9 |
|
10 |
def preprocess(image):
|
11 |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
12 |
+
# blur = cv2.GaussianBlur(gray, (3,3),6)
|
13 |
blur = cv2.bilateralFilter(gray,9,75,75)
|
14 |
threshold_img = cv2.adaptiveThreshold(blur,255,1,1,11,2)
|
15 |
return threshold_img
|
|
|
170 |
puzzle = Image.open(uploaded_file)
|
171 |
col1.image(puzzle, use_column_width=True)
|
172 |
puzzle = np.asarray(puzzle)
|
173 |
+
|
174 |
# Resizing puzzle to be solved
|
175 |
puzzle = cv2.resize(puzzle, (450,450))
|
176 |
# Preprocessing Puzzle
|