zuzu commited on
Commit
f4981c8
1 Parent(s): 7ecb7af

new examples and fixed clear button

Browse files
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
- ["writer001_pass01_digit2.png"],
26
- ["writer001_pass01_digit4.png"],
27
- ["writer001_pass07_digit9.png"],
28
- ["writer594_pass06_digit7.png"]]).launch()
 
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)