zuzu
commited on
Commit
•
f4981c8
1
Parent(s):
7ecb7af
new examples and fixed clear button
Browse files- 2.png +0 -0
- 4.png +0 -0
- 8.png +0 -0
- 9.png +0 -0
- app.py +6 -4
- writer001_pass01_digit2.png +0 -0
- writer001_pass01_digit4.png +0 -0
- writer001_pass07_digit9.png +0 -0
- writer594_pass06_digit7.png +0 -0
2.png
ADDED
![]() |
4.png
ADDED
![]() |
8.png
ADDED
![]() |
9.png
ADDED
![]() |
app.py
CHANGED
@@ -6,6 +6,8 @@ import cv2
|
|
6 |
model = tf.keras.models.load_model("mymodel/mymodel")
|
7 |
|
8 |
def predict(img):
|
|
|
|
|
9 |
z = tf.keras.preprocessing.image.img_to_array(img)
|
10 |
kernel = np.ones((5,5),np.uint8)
|
11 |
z = cv2.dilate(z ,kernel,iterations = 1)
|
@@ -22,7 +24,7 @@ gr.Interface(fn=predict,
|
|
22 |
outputs="label",
|
23 |
live=True,
|
24 |
examples=[
|
25 |
-
["
|
26 |
-
["
|
27 |
-
["
|
28 |
-
["
|
|
|
6 |
model = tf.keras.models.load_model("mymodel/mymodel")
|
7 |
|
8 |
def predict(img):
|
9 |
+
if img is None:
|
10 |
+
return
|
11 |
z = tf.keras.preprocessing.image.img_to_array(img)
|
12 |
kernel = np.ones((5,5),np.uint8)
|
13 |
z = cv2.dilate(z ,kernel,iterations = 1)
|
|
|
24 |
outputs="label",
|
25 |
live=True,
|
26 |
examples=[
|
27 |
+
["8.png"],
|
28 |
+
["4.png"],
|
29 |
+
["9.png"],
|
30 |
+
["2.png"]]).launch()
|
writer001_pass01_digit2.png
DELETED
Binary file (875 Bytes)
|
|
writer001_pass01_digit4.png
DELETED
Binary file (422 Bytes)
|
|
writer001_pass07_digit9.png
DELETED
Binary file (384 Bytes)
|
|
writer594_pass06_digit7.png
DELETED
Binary file (456 Bytes)
|
|